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

Functions

int UpnpGetIfInfo (const std::string &a_iface="")
 Retrieve local network adapter information and keep it in global variables.
 
int GetFreeHandle ()
 Get a free UPnP Unit handle.
 
int FreeHandle (int Upnp_Handle)
 Free handle.
 

Variables

Handle_InfoHandleTable [NUM_HANDLE]
 UPnP Device and Control Point handle table

 

Function Documentation

◆ UpnpGetIfInfo()

int anonymous_namespace{upnpapi.cpp}::UpnpGetIfInfo ( const std::string &  a_iface = "")

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

If no or empty argument given, the operating system should find the best suitable local network adapter for operation as specified by RFC3484 - Default Address Selection. The IPv6 loopback address - as specified - is handled as link local unicast address. Always only one local IP address is selected.

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 -> not supported, still empty (see gIF_IPV6_ULA_GUA).
  • gIF_IPV4_NETMASK -> not supported, still empty (see gIF_IPV6_ULA_GUA).
  • gIF_IPV6 -> IPv6 LLA address (if any).
  • gIF_IPV6_PREFIX_LENGTH -> IPv6 LLA address prefix length.
  • gIF_IPV6_ULA_GUA -> GUA IPv6 address or IPv4 mapped IPv6 address (if any)
  • gIF_IPV6_ULA_GUA_PREFIX_LENGTH -> Prefix length of gIF_IPV6_ULA_GUA.
Returns
UPNP_E_SUCCESS or UPNP_E_INVALID_INTERFACE.
Parameters
[in]a_ifaceAdapter name, netaddress, or netadapter index. If no or empty argument ("") given, we'll find the best suitable local network adapter for operation.

Definition at line 257 of file upnpapi.cpp.

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

◆ GetFreeHandle()

int anonymous_namespace{upnpapi.cpp}::GetFreeHandle ( )

Get a free UPnP Unit handle.

Returns
On success: an integer greater than zero
On error: UPNP_E_OUTOF_HANDLE

Definition at line 376 of file upnpapi.cpp.

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

◆ FreeHandle()

int anonymous_namespace{upnpapi.cpp}::FreeHandle ( int  Upnp_Handle)

Free handle.

Returns
UPNP_E_SUCCESS if successful or UPNP_E_INVALID_HANDLE if not.
Parameters
[in]Upnp_HandleHandle index.

Definition at line 397 of file upnpapi.cpp.

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

Variable Documentation

◆ HandleTable

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

UPnP Device and Control Point handle table

Definition at line 365 of file upnpapi.cpp.