libUPnP 1.14.19
|
#include "LinkedList.h"
#include "config.h"
#include "ixml.h"
#include "upnp.h"
#include "upnpdebug.h"
#include "uri.h"
#include <stdio.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. | |
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. | |
subscription * | GetFirstSubscription (service_info *service) |
Gets pointer to the first subscription node in the service table. | |
subscription * | GetNextSubscription (service_info *service, subscription *current) |
Get current and valid subscription from the service table. | |
void | freeSubscription (subscription *sub) |
Free's the memory allocated for storing the URL of the subscription. | |
void | freeSubscriptionList (subscription *head) |
Free's memory allocated for all the subscriptions in the service table. | |
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. | |
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. | |
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. | |
void | printService (service_info *service, Upnp_LogLevel level, Dbg_Module module) |
For debugging purposes prints information from the service passed into the function. | |
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. | |
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. | |
void | freeService (service_info *in) |
Free's memory allocated for the various components of the service entry in the service table. | |
void | freeServiceList (service_info *head) |
Free's memory allocated for the various components of each service entry in the service table. | |
void | freeServiceTable (service_table *table) |
Free's dynamic memory in table (does not free table, only memory within the structure). | |
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. | |
int | addServiceTable (IXML_Node *node, service_table *in, const char *DefaultURLBase) |
Add Service to the table. | |
int | getServiceTable (IXML_Node *node, service_table *out, const char *DefaultURLBase) |
Retrieve service from the table. | |
DOMString | getElementValue (IXML_Node *node) |
Returns the clone of the element value. | |
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. | |
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 ixmlCloneDOMString().
int copy_subscription | ( | subscription * | in, |
subscription * | out | ||
) |
Makes a copy of the subscription.
[in] | in | Source subscription. |
[in] | out | Destination subscription. |
References copy_URL_list().
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(), and token_cmp().
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(), and token_cmp().
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 ixmlFreeDOMString().
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 ixmlFreeDOMString().
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 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().
void freeSubscriptionList | ( | subscription * | head | ) |
Free's memory allocated for all the subscriptions in the service table.
[in] | head | Head of the subscription list. |
Returns the clone of the element value.
[in] | node | Input node which provides the list of child nodes. |
References DOMString, ixmlCloneDOMString(), ixmlNode_getFirstChild(), ixmlNode_getNodeType(), and ixmlNode_getNodeValue().
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. |
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. |
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 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(), ixmlNode_getNextSibling(), ixmlNode_getNodeName(), and ixmlNode_getNodeType().
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. |
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().
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 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, 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. |