Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
upnp.cpp File Reference

Definitions for UPnP port mapping. More...

#include <array>
#include <bit>
#include <chrono>
#include <filesystem>
#include <fstream>
#include <set>
#include <sstream>
#include <fcntl.h>
#include <unistd.h>
#include <stddef.h>
#include <miniupnpc/miniupnpc.h>
#include <miniupnpc/upnpcommands.h>
#include "config.h"
#include "confighttp.h"
#include "globals.h"
#include "logging.h"
#include "network.h"
#include "nvhttp.h"
#include "rtsp.h"
#include "stream.h"
#include "upnp.h"
#include "upnp_mapping.h"
#include "utility.h"
Include dependency graph for upnp.cpp:

Go to the source code of this file.

Classes

struct  upnp::mapping_t
 UPnP port mapping description and lease state. More...
struct  upnp::igd_t
 A discovered IGD and the data needed to manage its port mappings. More...
class  upnp::deinit_t
 RAII helper that runs shutdown cleanup when destroyed. More...

Namespaces

namespace  upnp
 UPnP port mapping.

Functions

igd_status_e upnp::UPNP_GetValidIGDStatus (device_t &device, urls_t *urls, IGDdatas *data, std::array< char, INET6_ADDRESS_STRLEN > &lan_addr)
 Get the valid IGD status.
bool upnp::is_valid_igd (igd_status_e status)
 Check whether a UPNP_GetValidIGD() status code identifies a usable IGD.
int upnp::shared_prefix_length (std::string_view a, std::string_view b)
 Count the leading bits two IPv4 addresses have in common.
std::string upnp::url_host (std::string_view url)
 Extract the host from a URL such as http://192.168.1.1:1900/rootDesc.xml.
std::size_t upnp::select_inner_igd (const std::vector< std::string > &igd_hosts, std::string_view lan_addr)
 Select the IGD of the network Hermes is attached to.
std::optional< std::size_t > upnp::select_outer_igd (const std::vector< std::string > &igd_hosts, std::size_t inner, std::string_view inner_external_addr)
 Select the IGD in front of the inner gateway when Hermes is behind two routers (double NAT).
std::unique_ptr< platf::deinit_t > upnp::start ()
 Start UPnP port mapping and return its shutdown guard.

Detailed Description

Definitions for UPnP port mapping.

Definition in file upnp.cpp.