Manage the UPnP Services of a UPnP Device if available. More...
Go to the source code of this file.
Classes | |
struct | subscription |
device subscriptions More... | |
struct | service_info |
-brief Service information More... | |
struct | service_table |
table of services More... | |
Macros | |
#define | SID_SIZE (size_t)41 |
??? | |
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) |
Remove the subscription from the service table and update it. | |
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 to find a service. | |
service_info * | FindServiceEventURLPath (service_table *table, const char *eventURLPath) |
Traverses the service table and finds the node whose event URL Path matches a known value. | |
service_info * | FindServiceControlURLPath (service_table *table, const char *controlURLPath) |
Traverses the service table and finds the node whose control URL Path matches a known value. | |
void | printService (service_info *service, Upnp_LogLevel level, Dbg_Module module) |
prints information from the service passed into the function. | |
void | printServiceList (service_info *service, Upnp_LogLevel level, Dbg_Module module) |
Prints information of each service from the service table passed into the function. | |
void | printServiceTable (service_table *table, Upnp_LogLevel level, Dbg_Module module) |
Prints the URL base of the table and information of each service from the service table. | |
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) |
Remove all services for a root device. | |
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. | |
Manage the UPnP Services of a UPnP Device if available.
This is only available if the Device Module was selected at compile time.
Definition in file service_table.hpp.
struct subscription |
device subscriptions
Definition at line 53 of file service_table.hpp.
Class Members | ||
---|---|---|
Upnp_SID | sid | Part of subscription. |
int | ToSendEventKey | Part of subscription. |
time_t | expireTime | Part of subscription. |
int | active | Part of subscription. |
URL_list | DeliveryURLs | Part of subscription. |
LinkedList | outgoing |
List of queued events for this subscription. Only one event job at a time goes into the thread pool. The first element in the list is a copy of the active job. Others are activated on job completion. |
struct subscription * | next | Part of subscription. |
struct service_info |
-brief Service information
Definition at line 71 of file service_table.hpp.
Class Members | ||
---|---|---|
DOMString | serviceType | Part of Service information. |
DOMString | serviceId | Part of Service information. |
char * | SCPDURL | Part of Service information. |
char * | controlURL | Part of Service information. |
char * | eventURL | Part of Service information. |
DOMString | UDN | Part of Service information. |
int | active | Part of Service information. |
int | TotalSubscriptions | Part of Service information. |
subscription * | subscriptionList | Part of Service information. |
struct service_info * | next | Part of Service information. |
struct service_table |
table of services
Definition at line 93 of file service_table.hpp.
Class Members | ||
---|---|---|
DOMString | URLBase | Part of the service table. |
service_info * | serviceList | Part of the service table. |
service_info * | endServiceList | Part of the service table. |
#define SID_SIZE (size_t)41 |
???
Definition at line 50 of file service_table.hpp.
void freeSubscriptionQueuedEvents | ( | subscription * | sub | ) |
???
Definition at line 905 of file gena_device.cpp.
int copy_subscription | ( | subscription * | in, |
subscription * | out | ||
) |
Makes a copy of the subscription.
[in] | in | Source subscription. |
[out] | out | Destination subscription. |
Definition at line 233 of file service_table.cpp.
void RemoveSubscriptionSID | ( | Upnp_SID | sid, |
service_info * | service | ||
) |
Remove the subscription from the service table and update it.
[in] | sid | Subscription ID. |
[in] | service | Service object providing the list of subscriptions. |
Definition at line 250 of file service_table.cpp.
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. |
Definition at line 272 of file service_table.cpp.
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. |
Definition at line 304 of file service_table.cpp.
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. |
Definition at line 316 of file service_table.cpp.
void freeSubscription | ( | subscription * | sub | ) |
Free's the memory allocated for storing the URL of the subscription.
[in] | sub | Subscription object to be freed. |
Definition at line 346 of file service_table.cpp.
void freeSubscriptionList | ( | subscription * | head | ) |
Free's memory allocated for all the subscriptions in the service table.
[in] | head | Head of the subscription list. |
Definition at line 353 of file service_table.cpp.
service_info * FindServiceId | ( | service_table * | table, |
const char * | serviceId, | ||
const char * | UDN | ||
) |
Traverses through the service table to find a service.
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. |
Definition at line 364 of file service_table.cpp.
service_info * FindServiceEventURLPath | ( | service_table * | table, |
const char * | eventURLPath | ||
) |
Traverses the service table and finds the node whose event URL Path matches a known value.
[in] | table | Service table. |
[in] | eventURLPath | Event URL path used to find a service from the table. |
Definition at line 383 of file service_table.cpp.
service_info * FindServiceControlURLPath | ( | service_table * | table, |
const char * | controlURLPath | ||
) |
Traverses the service table and finds the node whose control URL Path matches a known value.
[in] | table | Service table. |
[in] | controlURLPath | Control URL path used to find a service from the table. |
Definition at line 412 of file service_table.cpp.
void printService | ( | service_info * | service, |
Upnp_LogLevel | level, | ||
Dbg_Module | module | ||
) |
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. |
Definition at line 442 of file service_table.cpp.
void printServiceList | ( | service_info * | service, |
Upnp_LogLevel | level, | ||
Dbg_Module | module | ||
) |
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. |
Definition at line 481 of file service_table.cpp.
void printServiceTable | ( | service_table * | table, |
Upnp_LogLevel | level, | ||
Dbg_Module | module | ||
) |
Prints the URL base of the table and information of each service from the service table.
[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. |
Definition at line 521 of file service_table.cpp.
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. |
Definition at line 531 of file service_table.cpp.
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. |
Definition at line 559 of file service_table.cpp.
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. |
Definition at line 585 of file service_table.cpp.
int removeServiceTable | ( | IXML_Node * | node, |
service_table * | in | ||
) |
Remove all services for a root device.
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. |
Definition at line 592 of file service_table.cpp.
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. |
Definition at line 649 of file service_table.cpp.
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. |
Definition at line 679 of file service_table.cpp.
Returns the clone of the element value.
[in] | node | Input node which provides the list of child nodes. |
Definition at line 704 of file service_table.cpp.
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. |
Definition at line 717 of file service_table.cpp.