Functions | |
int | GeneratePropertySet (char **names, char **values, int count, DOMString *out) |
Generates XML property set for notifications. | |
void | free_notify_struct (notify_thread_struct *input) |
Frees memory used in notify_threads if the reference count is 0, otherwise decrements the refrence count. | |
int | notify_send_and_recv (uri_type *destination_url, membuffer *mid_msg, char *propertySet, http_parser_t *response) |
Sends the notify message and returns a reply. | |
int | genaNotify (char *headers, char *propertySet, subscription *sub) |
Function to Notify a particular subscription of a particular event. | |
void | genaNotifyThread (void *input) |
Thread job to Notify a control point. | |
char * | AllocGenaHeaders (const DOMString propertySet) |
Allocates the GENA header. | |
int | genaInitNotifyCommon (UpnpDevice_Handle device_handle, char *UDN, char *servId, DOMString propertySet, const Upnp_SID sid) |
We take ownership of propertySet and will free it. | |
void | maybeDiscardEvents (LinkedList *listp) |
This gets called before queuing a new event. | |
int | genaNotifyAllCommon (UpnpDevice_Handle device_handle, char *UDN, char *servId, DOMString propertySet) |
We take ownership of propertySet and will free it. | |
int | respond_ok (SOCKINFO *info, int time_out, subscription *sub, http_message_t *request) |
Returns OK message in the case of a subscription request. | |
int | create_url_list (memptr *url_list, URL_list *out) |
Function to parse the Callback header value in subscription requests. | |
int anonymous_namespace{gena_device.cpp}::GeneratePropertySet | ( | char ** | names, |
char ** | values, | ||
int | count, | ||
DOMString * | out | ||
) |
Generates XML property set for notifications.
[in] | names | Array of variable names (go in the event notify). |
[in] | values | Array of variable values (go in the event notify). |
[in] | count | number of variables. |
[out] | out | PropertySet node in the string format. |
Definition at line 69 of file gena_device.cpp.
void anonymous_namespace{gena_device.cpp}::free_notify_struct | ( | notify_thread_struct * | input | ) |
Frees memory used in notify_threads if the reference count is 0, otherwise decrements the refrence count.
[in] | input | Notify structure. |
Definition at line 118 of file gena_device.cpp.
|
inline |
Sends the notify message and returns a reply.
[in] | destination_url | subscription callback URL (URL of the control point). |
[in] | mid_msg | Common HTTP headers. |
[in] | propertySet | The evented XML. |
[out] | response | The response from the control point. |
Definition at line 139 of file gena_device.cpp.
int anonymous_namespace{gena_device.cpp}::genaNotify | ( | char * | headers, |
char * | propertySet, | ||
subscription * | sub | ||
) |
Function to Notify a particular subscription of a particular event.
In general the service should NOT be blocked around this call (this may cause deadlock with a client).
NOTIFY http request is sent and the reply is processed.
[in] | headers | Null terminated, includes all headers (including \r\n) except SID and SEQ. |
[in] | propertySet | The evented XML. |
[in] | sub | subscription to be Notified, assumes this is valid for life of function. |
Definition at line 218 of file gena_device.cpp.
void anonymous_namespace{gena_device.cpp}::genaNotifyThread | ( | void * | input | ) |
Thread job to Notify a control point.
It validates the subscription and copies the subscription. Also make sure that events are sent in order.
[in] | input | notify thread structure containing all the headers and property set info. |
Definition at line 276 of file gena_device.cpp.
char * anonymous_namespace{gena_device.cpp}::AllocGenaHeaders | ( | const DOMString | propertySet | ) |
Allocates the GENA header.
[in] | propertySet | Pointer to the property set string. |
Definition at line 369 of file gena_device.cpp.
int anonymous_namespace{gena_device.cpp}::genaInitNotifyCommon | ( | UpnpDevice_Handle | device_handle, |
char * | UDN, | ||
char * | servId, | ||
DOMString | propertySet, | ||
const Upnp_SID | sid | ||
) |
We take ownership of propertySet and will free it.
Definition at line 404 of file gena_device.cpp.
void anonymous_namespace{gena_device.cpp}::maybeDiscardEvents | ( | LinkedList * | listp | ) |
This gets called before queuing a new event.
Definition at line 557 of file gena_device.cpp.
int anonymous_namespace{gena_device.cpp}::genaNotifyAllCommon | ( | UpnpDevice_Handle | device_handle, |
char * | UDN, | ||
char * | servId, | ||
DOMString | propertySet | ||
) |
We take ownership of propertySet and will free it.
Definition at line 586 of file gena_device.cpp.
int anonymous_namespace{gena_device.cpp}::respond_ok | ( | SOCKINFO * | info, |
int | time_out, | ||
subscription * | sub, | ||
http_message_t * | request | ||
) |
Returns OK message in the case of a subscription request.
[in] | info | Socket connection of request. |
[in] | time_out | Accepted duration. |
[in] | sub | Accepted subscription. |
[in] | request | Http request. |
Definition at line 732 of file gena_device.cpp.
Function to parse the Callback header value in subscription requests.
Takes in a buffer containing URLS delimited by '<' and '>'. The entire buffer is copied into dynamic memory and stored in the URL_list. Pointers to the individual urls within this buffer are allocated and stored in the URL_list. Only URLs with network addresses are considered (i.e. host:port or domain name).
[in] | url_list | . |
[out] | out | . |
Definition at line 802 of file gena_device.cpp.