Sunshine latest
Self-hosted game stream host for Moonlight.
upnp Namespace Reference

UPnP port mapping. More...

Classes

class  deinit_t
 
struct  mapping_t
 

Typedefs

using device_t = util::safe_ptr<UPNPDev, freeUPNPDevlist>
 

Functions

 KITTY_USING_MOVE_T (urls_t, UPNPUrls,, { FreeUPNPUrls(&el);})
 
std::unique_ptr< platf::deinit_tstart ()
 
int UPNP_GetValidIGDStatus (device_t &device, urls_t *urls, IGDdatas *data, std::array< char, INET6_ADDRESS_STRLEN > &lan_addr)
 Get the valid IGD status.
 

Variables

constexpr auto INET6_ADDRESS_STRLEN = 46
 
constexpr auto IPv4 = 0
 
constexpr auto IPv6 = 1
 
constexpr auto PORT_MAPPING_LIFETIME = 3600s
 
constexpr auto REFRESH_INTERVAL = 120s
 

Detailed Description

UPnP port mapping.

Function Documentation

◆ UPNP_GetValidIGDStatus()

int upnp::UPNP_GetValidIGDStatus ( device_t & device,
urls_t * urls,
IGDdatas * data,
std::array< char, INET6_ADDRESS_STRLEN > & lan_addr )

Get the valid IGD status.

This function is a wrapper around UPNP_GetValidIGD() that returns the status code. There is a pre-processor check to determine which version of the function to call based on the version of the MiniUPnPc library.

Parameters
deviceThe device.
urlsThe URLs.
dataThe IGD data.
lan_addrThe LAN address.
Returns
The UPnP Status.
Return values
0No IGD found.
1A valid connected IGD has been found.
2A valid IGD has been found but it reported as not connected.
3An UPnP device has been found but was not recognized as an IGD.