libUPnP 1.14.23
|
#include "LinkedList.h"
#include "config.h"
#include "ixml.h"
#include "upnp.h"
#include "upnpdebug.h"
#include "uri.h"
#include <time.h>
Go to the source code of this file.
Data Structures | |
struct | SUBSCRIPTION |
struct | SERVICE_INFO |
struct | SERVICE_TABLE |
Macros | |
#define | SID_SIZE (size_t)41 |
Typedefs | |
typedef struct SUBSCRIPTION | subscription |
typedef struct SERVICE_INFO | service_info |
typedef struct SERVICE_TABLE | service_table |
Functions | |
void | freeSubscriptionQueuedEvents (subscription *sub) |
int | copy_subscription (subscription *in, subscription *out) |
Makes a copy of the subscription. More... | |
void | RemoveSubscriptionSID (Upnp_SID sid, service_info *service) |
subscription * | GetSubscriptionSID (const Upnp_SID sid, service_info *service) |
Return the subscription from the service table that matches const Upnp_SID sid value. More... | |
subscription * | GetFirstSubscription (service_info *service) |
Gets pointer to the first subscription node in the service table. More... | |
subscription * | GetNextSubscription (service_info *service, subscription *current) |
Get current and valid subscription from the service table. More... | |
void | freeSubscription (subscription *sub) |
Free's the memory allocated for storing the URL of the subscription. More... | |
void | freeSubscriptionList (subscription *head) |
Free's memory allocated for all the subscriptions in the service table. More... | |
service_info * | FindServiceId (service_table *table, const char *serviceId, const char *UDN) |
Traverses through the service table and returns a pointer to the service node that matches a known service id and a known UDN. More... | |
service_info * | FindServiceEventURLPath (service_table *table, const char *eventURLPath) |
Traverses the service table and finds the node whose event URL Path matches a know value. More... | |
service_info * | FindServiceControlURLPath (service_table *table, const char *controlURLPath) |
Traverses the service table and finds the node whose control URL Path matches a know value. More... | |
void | printService (service_info *service, Upnp_LogLevel level, Dbg_Module module) |
For debugging purposes prints information from the service passed into the function. More... | |
void | printServiceList (service_info *service, Upnp_LogLevel level, Dbg_Module module) |
For debugging purposes prints information of each service from the service table passed into the function. More... | |
void | printServiceTable (service_table *table, Upnp_LogLevel level, Dbg_Module module) |
For debugging purposes prints the URL base of the table and information of each service from the service table passed into the function. More... | |
void | freeService (service_info *in) |
Free's memory allocated for the various components of the service entry in the service table. More... | |
void | freeServiceList (service_info *head) |
Free's memory allocated for the various components of each service entry in the service table. More... | |
void | freeServiceTable (service_table *table) |
Free's dynamic memory in table (does not free table, only memory within the structure). More... | |
int | removeServiceTable (IXML_Node *node, service_table *in) |
This function assumes that services for a particular root device are placed linearly in the service table, and in the order in which they are found in the description document all services for this root device are removed from the list. More... | |
int | addServiceTable (IXML_Node *node, service_table *in, const char *DefaultURLBase) |
Add Service to the table. More... | |
int | getServiceTable (IXML_Node *node, service_table *out, const char *DefaultURLBase) |
Retrieve service from the table. More... | |
DOMString | getElementValue (IXML_Node *node) |
Returns the clone of the element value. More... | |
int | getSubElement (const char *element_name, IXML_Node *node, IXML_Node **out) |
Traverses through a list of XML nodes to find the node with the known element name. More... | |
int addServiceTable | ( | IXML_Node * | node, |
service_table * | in, | ||
const char * | DefaultURLBase | ||
) |
Add Service to the table.
[in] | node | XML node information. |
[in] | in | Service table that will be initialized with services. |
[in] | DefaultURLBase | Default base URL on which the URL will be returned to the service list. |
References getElementValue(), getSubElement(), and ixmlCloneDOMString().
int copy_subscription | ( | subscription * | in, |
subscription * | out | ||
) |
Makes a copy of the subscription.
[in] | in | Source subscription. |
[in] | out | Destination subscription. |
service_info * FindServiceControlURLPath | ( | service_table * | table, |
const char * | controlURLPath | ||
) |
Traverses the service table and finds the node whose control URL Path matches a know value.
[in] | table | Service table. |
[in] | controlURLPath | Control URL path used to find a service from the table. |
References parse_uri().
service_info * FindServiceEventURLPath | ( | service_table * | table, |
const char * | eventURLPath | ||
) |
Traverses the service table and finds the node whose event URL Path matches a know value.
[in] | table | Service table. |
[in] | eventURLPath | Event URL path used to find a service from the table. |
References parse_uri().
service_info * FindServiceId | ( | service_table * | table, |
const char * | serviceId, | ||
const char * | UDN | ||
) |
Traverses through the service table and returns a pointer to the service node that matches a known service id and a known UDN.
[in] | table | Service table. |
[in] | serviceId | String representing the service id to be found among those in the table. |
[in] | UDN | String representing the UDN to be found among those in the table. |
void freeService | ( | service_info * | in | ) |
Free's memory allocated for the various components of the service entry in the service table.
[in] | in | Service information that is to be freed. |
References freeSubscriptionList(), and ixmlFreeDOMString().
Referenced by removeServiceTable().
void freeServiceList | ( | service_info * | head | ) |
Free's memory allocated for the various components of each service entry in the service table.
[in] | head | Head of the service list to be freed. |
References freeSubscriptionList(), and ixmlFreeDOMString().
Referenced by freeServiceTable().
void freeServiceTable | ( | service_table * | table | ) |
Free's dynamic memory in table (does not free table, only memory within the structure).
[in] | table | Service table whose internal memory needs to be freed. |
References freeServiceList(), and ixmlFreeDOMString().
void freeSubscription | ( | subscription * | sub | ) |
Free's the memory allocated for storing the URL of the subscription.
[in] | sub | Subscription object to be freed. |
References free_URL_list().
Referenced by freeSubscriptionList().
void freeSubscriptionList | ( | subscription * | head | ) |
Free's memory allocated for all the subscriptions in the service table.
[in] | head | Head of the subscription list. |
References freeSubscription().
Referenced by freeService(), freeServiceList(), GetNextSubscription(), GetSubscriptionSID(), and RemoveSubscriptionSID().
Returns the clone of the element value.
[in] | node | Input node which provides the list of child nodes. |
References DOMString, ixmlNode_getFirstChild(), and ixmlNode_getNodeType().
Referenced by addServiceTable(), getServiceTable(), and removeServiceTable().
subscription * GetFirstSubscription | ( | service_info * | service | ) |
Gets pointer to the first subscription node in the service table.
[in] | service | Service object providing the list of subscriptions. |
References GetNextSubscription().
subscription * GetNextSubscription | ( | service_info * | service, |
subscription * | current | ||
) |
Get current and valid subscription from the service table.
[in] | service | Service object providing the list of subscriptions. |
[in] | current | Current subscription object. |
References freeSubscriptionList().
Referenced by GetFirstSubscription().
int getServiceTable | ( | IXML_Node * | node, |
service_table * | out, | ||
const char * | DefaultURLBase | ||
) |
Retrieve service from the table.
[in] | node | XML node information. |
[in] | out | Output parameter which will contain the service list and URL. |
[in] | DefaultURLBase | Default base URL on which the URL will be returned. |
References getElementValue(), getSubElement(), and ixmlCloneDOMString().
Traverses through a list of XML nodes to find the node with the known element name.
[in] | element_name | Sub element name to be searched for. |
[in] | node | Input node which provides the list of child nodes. |
[out] | out | Ouput node to which the matched child node is returned. |
References DOMString, ixmlNode_getFirstChild(), and ixmlNode_getNodeType().
Referenced by addServiceTable(), getServiceTable(), and removeServiceTable().
subscription * GetSubscriptionSID | ( | const Upnp_SID | sid, |
service_info * | service | ||
) |
Return the subscription from the service table that matches const Upnp_SID sid value.
[in] | sid | Subscription ID. |
[in] | service | Service object providing the list of subscriptions. |
References freeSubscriptionList().
void printService | ( | service_info * | service, |
Upnp_LogLevel | level, | ||
Dbg_Module | module | ||
) |
For debugging purposes prints information from the service passed into the function.
[in] | service | Service whose information is to be printed. |
[in] | level | Debug level specified to the print function. |
[in] | module | Debug module specified to the print function. |
References UpnpPrintf().
void printServiceList | ( | service_info * | service, |
Upnp_LogLevel | level, | ||
Dbg_Module | module | ||
) |
For debugging purposes prints information of each service from the service table passed into the function.
[in] | service | Service whose information is to be printed. |
[in] | level | Debug level specified to the print function. |
[in] | module | Debug module specified to the print function. |
References UpnpPrintf().
Referenced by printServiceTable().
void printServiceTable | ( | service_table * | table, |
Upnp_LogLevel | level, | ||
Dbg_Module | module | ||
) |
For debugging purposes prints the URL base of the table and information of each service from the service table passed into the function.
[in] | table | Service table to be printed. |
[in] | level | Debug level specified to the print function. |
[in] | module | Debug module specified to the print function. |
References printServiceList(), and UpnpPrintf().
int removeServiceTable | ( | IXML_Node * | node, |
service_table * | in | ||
) |
This function assumes that services for a particular root device are placed linearly in the service table, and in the order in which they are found in the description document all services for this root device are removed from the list.
[in] | node | XML node information. |
[in] | in | Service table from which services will be removed. |
References DOMString, freeService(), getElementValue(), getSubElement(), ixmlElement_getElementsByTagName(), ixmlFreeDOMString(), ixmlNodeList_free(), and ixmlNodeList_length().
void RemoveSubscriptionSID | ( | Upnp_SID | sid, |
service_info * | service | ||
) |
[in] | sid | Subscription ID. |
[in] | service | Service object providing the list of subscriptions. |
References freeSubscriptionList().