UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
compa::anonymous_namespace{upnpapi.cpp} Namespace Reference

Functions

int UpnpGetIfInfo (std::string_view a_iface="")
 Retrieve local network adapter information and keep it in global variables.
 
int UpnpRegisterRootDevice3 (const char *const DescUrl, const Upnp_FunPtr Fun, const void *const Cookie, UpnpDevice_Handle *const Hnd, const int AddressFamily, const char *const LowerDescUrl)
 

Variables

pthread_mutex_t sdkInit_mutex = PTHREAD_MUTEX_INITIALIZER
 Initialization mutex.
 
Handle_InfoHandleTable [NUM_HANDLE]
 UPnP Device and Control Point handle table

 

Function Documentation

◆ UpnpGetIfInfo()

int compa::anonymous_namespace{upnpapi.cpp}::UpnpGetIfInfo ( std::string_view  a_iface = "")

Retrieve local network adapter information and keep it in global variables.

If no or empty argument given, we'll find the best suitable local network adapter for operation. The IPv6 loopback address - as specified - is handled as link local unicast address.

The local network adapter must fulfill these requirements:

  • Be UP.
  • Support MULTICAST.
  • Have a valid IPv4 or IPv6 address.

We'll retrieve the following information from the adapter:

  • gIF_NAME -> adapter name (by input or found).
  • gIF_INDEX -> Unique local network adapter index number.
  • gIF_IPV4 -> IPv4 address (if any).
  • gIF_IPV4_NETMASK -> Netmask of gIF_IPV4 (if any).
  • gIF_IPV6 -> IPv6 LLA address (if any).
  • gIF_IPV6_PREFIX_LENGTH -> IPv6 LLA address prefix length.
  • gIF_IPV6_ULA_GUA -> ULA or GUA IPv6 address (if any).
  • gIF_IPV6_ULA_GUA_PREFIX_LENGTH -> IPv6 ULA or GUA address prefix length.
Returns
UPNP_E_SUCCESS or UPNP_E_INVALID_INTERFACE.
Parameters
[in]a_ifaceAdapter name or ip address. If no or empty argument ("") given, we'll find the best suitable local network adapter for operation.

Definition at line 120 of file upnpapi.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpnpRegisterRootDevice3()

int compa::anonymous_namespace{upnpapi.cpp}::UpnpRegisterRootDevice3 ( const char *const  DescUrl,
const Upnp_FunPtr  Fun,
const void *const  Cookie,
UpnpDevice_Handle *const  Hnd,
const int  AddressFamily,
const char *const  LowerDescUrl 
)
Todo:
Check DEVICE_SSDP vs. CTRLPT_SSDP against struct Handle_Info

Definition at line 1168 of file upnpapi.cpp.

+ Here is the call graph for this function:

Variable Documentation

◆ sdkInit_mutex

pthread_mutex_t compa::anonymous_namespace{upnpapi.cpp}::sdkInit_mutex = PTHREAD_MUTEX_INITIALIZER

Initialization mutex.

Definition at line 89 of file upnpapi.cpp.

◆ HandleTable

Handle_Info* compa::anonymous_namespace{upnpapi.cpp}::HandleTable[NUM_HANDLE]

UPnP Device and Control Point handle table

Definition at line 92 of file upnpapi.cpp.