Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
upnp_mapping.h File Reference

Ownership and recovery records for UPnP port mappings. More...

#include <algorithm>
#include <charconv>
#include <cstddef>
#include <cstdint>
#include <iomanip>
#include <optional>
#include <sstream>
#include <string>
#include <string_view>
#include <tuple>
#include <utility>
#include <vector>
Include dependency graph for upnp_mapping.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  upnp::owned_mapping_t
 A forwarding rule Hermes owns, including its gateway and destination. More...
struct  upnp::mapping_reply_t
 Fields returned by a specific or generic mapping query. More...
struct  upnp::mapping_lookup_t
 Verified ownership and lease information for one mapping. More...

Namespaces

namespace  upnp
 UPnP port mapping.

Enumerations

enum class  upnp::mapping_state_e {
  upnp::missing , upnp::ours , upnp::existing , upnp::conflict ,
  upnp::unknown
}
 Relationship between a gateway's existing mapping and the requested rule. More...

Functions

bool upnp::lease_needs_refresh (std::string_view lease)
 Detect an owned finite lease that needs replacement on routers that do not renew repeated adds.
mapping_state_e upnp::classify_mapping (int result, std::string_view client, std::string_view port, std::string_view description, const owned_mapping_t &wanted)
 Classify a lookup without treating a destination alone as proof of ownership.
bool upnp::may_manage_mapping (mapping_state_e state, bool recorded)
 Require a local ownership record as well as a matching router response.
template<class Specific, class Generic>
mapping_lookup_t upnp::verify_mapping_lookup (const owned_mapping_t &wanted, bool recorded, Specific specific, Generic generic)
 Verify an owned rule even when GetSpecificPortMappingEntry reports port zero.
bool upnp::should_retain_recovery_record (mapping_state_e state, bool permanent)
 Keep permanent recovery records when router ownership is ambiguous.
std::string upnp::mapping_journal_event (const owned_mapping_t &mapping, bool added)
 Encode one append-only recovery event before adding or after removing a permanent rule.
std::vector< owned_mapping_t > upnp::read_mapping_journal (const std::string &text)
 Recover outstanding permanent rules, ignoring incomplete or invalid journal lines.

Detailed Description

Ownership and recovery records for UPnP port mappings.

Definition in file upnp_mapping.h.