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

Functions

Scope restricted to file
int addrToString (const sockaddr *addr, char *ipaddr_port, size_t ipaddr_port_size)
 Converts an Internet address to a string and stores it in a buffer.
 
int calc_alias (const char *alias, const char *rootPath, char **newAlias)
 Determine alias based urlbase's root path.
 
int calc_descURL (const char *ipPortStr, const char *alias, char descURL[LINE_SIZE])
 Determines the description URL.
 
int config_description_doc (IXML_Document *doc, const char *ip_str, char **root_path_str)
 Configure the description document.
 

Function Documentation

◆ addrToString()

int anonymous_namespace{urlconfig.cpp}::addrToString ( const sockaddr *  addr,
char *  ipaddr_port,
size_t  ipaddr_port_size 
)
inline

Converts an Internet address to a string and stores it in a buffer.

Returns
On success: UPNP_E_SUCCESS
On error: UPNP_E_BUFFER_TOO_SMALL - Given buffer doesn't have enough size.
Todo:
Check bugfix with gtest.
Parameters
[in]addrPointer to socket address with the IP Address and port information.
[out]ipaddr_portCharacter array which will hold the IP Address in a string format.
[in]ipaddr_port_sizeIpaddr_port buffer size.

Definition at line 68 of file urlconfig.cpp.

+ Here is the caller graph for this function:

◆ calc_alias()

int anonymous_namespace{urlconfig.cpp}::calc_alias ( const char *  alias,
const char *  rootPath,
char **  newAlias 
)
inline

Determine alias based urlbase's root path.

Returns
On success: UPNP_E_SUCCESS
On error: UPNP_E_OUTOF_MEMORY - On Failure to allocate memory for new *alias
Note
Parameter 'newAlias' should be freed after use with using free().
Parameters
[in]aliasString containing the alias.
[in]rootPathString containing the root path.
[out]newAliasString pointer to hold the modified new alias. After use it should be freed using free().

Definition at line 105 of file urlconfig.cpp.

+ Here is the caller graph for this function:

◆ calc_descURL()

int anonymous_namespace{urlconfig.cpp}::calc_descURL ( const char *  ipPortStr,
const char *  alias,
char  descURL[LINE_SIZE] 
)
inline

Determines the description URL.

Returns
On success: UPNP_E_SUCCESS
On error: UPNP_E_URL_TOO_BIG - length of the URL is determined to be to exceeding the limit.
Parameters
[in]ipPortStrString containing the portnumber.
[in]aliasString containing the alias.
[out]descURLBuffer to hold the calculated description URL.

Definition at line 150 of file urlconfig.cpp.

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

◆ config_description_doc()

int anonymous_namespace{urlconfig.cpp}::config_description_doc ( IXML_Document doc,
const char *  ip_str,
char **  root_path_str 
)
inline

Configure the description document.

Add the standard format and then add information from the root device and any child nodes.

Returns
On success: UPNP_E_SUCCESS
On error:
  • UPNP_E_OUTOF_MEMORY - Default Error
  • UPNP_E_INVALID_DESC - Invalid child node
  • UPNP_E_INVALID_URL - Invalid node information
Parameters
[in,out]docIMXL description document to be configured.
[in]ip_stripaddress string.
[out]root_path_strbuffer to hold the root path of the configured description document.

Definition at line 184 of file urlconfig.cpp.

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