51#include <webserver.hpp>
54#define STALE_JOBID (INVALID_JOB_ID - 1)
85 size += strlen(
"</e:propertyset>\n\n");
86 for (counter = 0; counter < count; counter++) {
87 size += strlen(
"<e:property>\n</e:property>\n");
88 size += 2 * strlen(names[counter]) + strlen(values[counter]) +
92 size_t buffer_len{size + 1};
93 buffer = (
char*)malloc(buffer_len);
96 memset(buffer, 0, size + 1);
102 for (counter = 0; counter < count; counter++) {
103 strcat(buffer,
"<e:property>\n");
104 snprintf(&buffer[strlen(buffer)], buffer_len,
105 "<%s>%s</%s>\n</e:property>\n", names[counter],
106 values[counter], names[counter]);
108 strcat(buffer,
"</e:propertyset>\n\n");
158 const char* CRLF =
"\r\n";
161 UpnpPrintf(UPNP_ALL, GENA, __FILE__, __LINE__,
"gena notify to: %.*s\n",
179 HTTPMETHOD_NOTIFY, &url, mid_msg->
buf) != 0) {
187 start_msg.
length, propertySet,
188 strlen(propertySet), CRLF, strlen(CRLF));
234 int return_code = -1;
241 headers,
"SID: ", sub->
sid,
256 if (response.msg.status_code == HTTP_OK)
259 if (response.msg.status_code == HTTP_PRECONDITION_FAILED)
375 static const char* HEADER_LINE_1 =
376 "CONTENT-TYPE: text/xml; charset=\"utf-8\"\r\n";
377 static const char* HEADER_LINE_2A =
"CONTENT-LENGTH: ";
378 static const char* HEADER_LINE_2B =
"\r\n";
379 static const char* HEADER_LINE_3 =
"NT: upnp:event\r\n";
380 static const char* HEADER_LINE_4 =
"NTS: upnp:propchange\r\n";
381 char* headers = NULL;
382 size_t headers_size = 0;
386 headers_size = strlen(HEADER_LINE_1) + strlen(HEADER_LINE_2A) +
388 strlen(HEADER_LINE_3) + strlen(HEADER_LINE_4) + 1;
389 headers = (
char*)malloc(headers_size);
390 if (headers == NULL) {
394 rc = snprintf(headers, headers_size,
"%s%s%" PRIzu
"%s%s%s", HEADER_LINE_1,
395 HEADER_LINE_2A, strlen(propertySet) + 2, HEADER_LINE_2B,
396 HEADER_LINE_3, HEADER_LINE_4);
399 if (headers == NULL || rc < 0 || (
unsigned int)rc >= headers_size) {
401 "AllocGenaHeaders(): Error UPNP_E_OUTOF_MEMORY\n");
413 int* reference_count = NULL;
414 char* UDN_copy = NULL;
415 char* servId_copy = NULL;
416 char* headers = NULL;
424 UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__,
425 "GENA BEGIN INITIAL NOTIFY COMMON\n");
435 reference_count = (
int*)malloc(
sizeof(
int));
436 if (reference_count == NULL) {
441 *reference_count = 0;
443 UDN_copy = strdup(UDN);
444 if (UDN_copy == NULL) {
450 servId_copy = strdup(servId);
451 if (servId_copy == NULL) {
459 if (
GetHandleInfo(device_handle, &handle_info) != HND_DEVICE) {
466 if (service == NULL) {
471 UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__,
472 "FOUND SERVICE IN INIT NOTFY: UDN %s, ServID: %s", UDN, servId);
475 if (sub == NULL || sub->
active) {
480 UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__,
481 "FOUND SUBSCRIPTION IN INIT NOTIFY: SID %s", sid);
485 if (headers == NULL) {
494 if (thread_struct == NULL) {
498 *reference_count = 1;
499 thread_struct->
servId = servId_copy;
500 thread_struct->
UDN = UDN_copy;
501 thread_struct->
headers = headers;
503 memset(thread_struct->
sid, 0,
sizeof(thread_struct->
sid));
504 strncpy(thread_struct->
sid, sid,
sizeof(thread_struct->
sid) - 1);
505 thread_struct->
ctime = time(0);
540 free(reference_count);
546 "GENA END INITIAL NOTIFY COMMON, ret = %d\n", ret);
561 time_t now = time(0L);
568 if (node == 0 || (node = node->next) == 0) {
570 fprintf(stderr,
"gena_device: maybeDiscardEvents: "
571 "list is inconsistent\n");
596 int* reference_count = NULL;
597 char* UDN_copy = NULL;
598 char* servId_copy = NULL;
599 char* headers = NULL;
606 UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__,
607 "GENA BEGIN NOTIFY ALL COMMON\n");
610 reference_count = (
int*)malloc(
sizeof(
int));
611 if (reference_count == NULL) {
616 *reference_count = 0;
618 UDN_copy = strdup(UDN);
619 if (UDN_copy == NULL) {
625 servId_copy = strdup(servId);
626 if (servId_copy == NULL) {
633 if (headers == NULL) {
641 if (
GetHandleInfo(device_handle, &handle_info) != HND_DEVICE) {
646 if (service != NULL) {
654 if (thread_s == NULL) {
660 (*reference_count)++;
662 thread_s->
UDN = UDN_copy;
663 thread_s->
servId = servId_copy;
666 strncpy(thread_s->
sid, finger->
sid,
sizeof thread_s->
sid);
667 thread_s->
sid[
sizeof thread_s->
sid - 1] = 0;
668 thread_s->
ctime = time(0);
716 if (reference_count && *reference_count == 0) {
721 free(reference_count);
727 "GENA END NOTIFY ALL COMMON, ret = %d\n", ret);
750 char timeout_str[100];
758 rc = snprintf(timeout_str,
sizeof(timeout_str),
"TIMEOUT: Second-%d",
761 memset(timeout_str, 0,
sizeof(timeout_str));
762 strncpy(timeout_str,
"TIMEOUT: Second-infinite",
763 sizeof(timeout_str) - 1);
765 if (rc < 0 || (
unsigned int)rc >=
sizeof(timeout_str)) {
803 if (
GetHandleInfo(device_handle, &handle_info) != HND_DEVICE) {
804 UpnpPrintf(UPNP_CRITICAL, GENA, __FILE__, __LINE__,
805 "genaUnregisterDevice: BAD Handle: %d\n", device_handle);
840 char** VarNames,
char** VarValues,
int var_count,
846 UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__,
847 "GENA BEGIN INITIAL NOTIFY\n");
849 if (var_count <= 0) {
860 UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__,
861 "GENERATED PROPERTY SET IN INIT NOTIFY: %s", propertySet);
868 "GENA END INITIAL NOTIFY, ret = %d\n", ret);
880 UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__,
881 "GENA BEGIN INITIAL NOTIFY EXT\n");
890 if (propertySet == NULL) {
895 UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__,
896 "GENERATED PROPERTY SET IN INIT EXT NOTIFY: %s", propertySet);
903 "GENA END INITIAL NOTIFY EXT, ret = %d\n", ret);
915 UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__,
916 "GENA BEGIN NOTIFY ALL EXT\n");
919 if (propertySet == NULL) {
924 UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__,
925 "GENERATED PROPERTY SET IN EXT NOTIFY: %s", propertySet);
932 "GENA END NOTIFY ALL EXT, ret = %d\n", ret);
938 char** VarNames,
char** VarValues,
int var_count) {
944 UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__,
"GENA BEGIN NOTIFY ALL\n");
951 UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__,
952 "GENERATED PROPERTY SET IN EXT NOTIFY: %s", propertySet);
959 "GENA END NOTIFY ALL, ret = %d\n", ret);
978 struct in_addr genaAddr4;
979 struct in_addr genaNetmask;
980 struct sockaddr_in* deliveryAddr4 = NULL;
981 struct in6_addr genaAddr6Lla;
982 struct in6_addr genaAddr6UlaGua;
983 struct in6_addr* genaAddr6 = NULL;
984 unsigned int if_prefix;
985 struct sockaddr_in6* deliveryAddr6 = NULL;
986 char deliveryAddrString[INET6_ADDRSTRLEN];
988 if (info == NULL || url_list == NULL) {
994 if (!inet_pton(AF_INET,
gIF_IPV4, &genaAddr4)) {
1002 for (i = 0; i < url_list->
size; i++) {
1003 deliveryAddr4 = (
struct sockaddr_in*)&url_list->
parsedURLs[i]
1005 if ((deliveryAddr4->sin_addr.s_addr & genaNetmask.s_addr) !=
1006 (genaAddr4.s_addr & genaNetmask.s_addr)) {
1007 inet_ntop(AF_INET, &deliveryAddr4->sin_addr, deliveryAddrString,
1008 sizeof(deliveryAddrString));
1009 UpnpPrintf(UPNP_CRITICAL, GENA, __FILE__, __LINE__,
1010 "DeliveryURL %s is invalid.\n"
1011 "It is not in the expected network "
1012 "segment (IPv4: %s, netmask: %s)\n",
1019 if (!inet_pton(AF_INET6,
gIF_IPV6, &genaAddr6Lla)) {
1027 for (i = 0; i < url_list->
size; i++) {
1028 deliveryAddr6 = (
struct sockaddr_in6*)&url_list->
parsedURLs[i]
1030 if (IN6_IS_ADDR_LINKLOCAL(&deliveryAddr6->sin6_addr)) {
1031 genaAddr6 = &genaAddr6Lla;
1034 genaAddr6 = &genaAddr6UlaGua;
1038 if (memcmp(deliveryAddr6->sin6_addr.s6_addr, genaAddr6->s6_addr,
1040 inet_ntop(AF_INET6, &deliveryAddr6->sin6_addr,
1041 deliveryAddrString,
sizeof(deliveryAddrString));
1042 UpnpPrintf(UPNP_CRITICAL, GENA, __FILE__, __LINE__,
1043 "DeliveryURL %s is invalid.\n"
1044 "It is not in the expected network "
1045 "segment (IPv6: %s, prefix: %d)\n",
1047 IN6_IS_ADDR_LINKLOCAL(&deliveryAddr6->sin6_addr)
1063 int return_code = 1;
1064 int time_out = 1801;
1073 char* event_url_path = NULL;
1078 UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__,
1079 "Subscription Request Received:\n");
1103 if (event_url_path == NULL) {
1108 UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__,
1109 "SubscriptionRequest for event URL path: %s\n", event_url_path);
1115 &handle_info, &service) != HND_DEVICE) {
1116 free(event_url_path);
1121 free(event_url_path);
1123 if (service == NULL || !service->
active) {
1129 UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__,
1130 "Subscription Request: Number of Subscriptions already %d\n "
1131 "Max Subscriptions allowed: %d\n",
1168 if (return_code == 0) {
1181 if (return_code != 0) {
1206 if (time_out >= 0) {
1216 rc = snprintf(sub->
sid,
sizeof(sub->
sid),
"uuid:%s", temp_sid);
1219 if (rc < 0 || (
unsigned int)rc >=
sizeof(sub->
sid) ||
1237 callback_fun = handle_info->
Callback;
1238 cookie = handle_info->
Cookie;
1255 int time_out = 1801;
1275 memcpy(sid, temp_hdr.
buf, temp_hdr.
length);
1276 sid[temp_hdr.
length] =
'\0';
1290 &device_handle, &handle_info, &service) != HND_DEVICE) {
1299 if (service == NULL || !service->
active ||
1306 UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__,
1307 "Renew request: Number of subscriptions already: %d\n "
1308 "Max Subscriptions allowed:%d\n",
1341 if (time_out == -1) {
1375 memcpy(sid, temp_hdr.
buf, temp_hdr.
length);
1376 sid[temp_hdr.
length] =
'\0';
1390 &device_handle, &handle_info, &service) != HND_DEVICE) {
1399 if (service == NULL || !service->
active ||
@ UPNP_EVENT_SUBSCRIPTION_REQUEST
int(* Upnp_FunPtr)(Upnp_EventType EventType, const void *Event, void *Cookie)
char Upnp_SID[44]
Holds the subscription identifier for a subscription between a client and a device.
int UpnpDevice_Handle
Returned when a device application registers with UpnpRegisterRootDevice(),UpnpRegisterRootDevice2(),...
int create_url_list(memptr *a_url_list, URL_list *a_out)
Function to parse the Callback header value in subscription requests.
http_message_t msg
entire raw message
uri_type uri
Type of a uri, e.g. absolute, relative, etc.
int major_version
Http major version.
#define HDR_NT
Type of a HTTP header.
#define HDR_CALLBACK
Type of a HTTP header.
int minor_version
Http minor version.
#define HDR_TIMEOUT
Type of a HTTP header.
#define HDR_SID
Type of a HTTP header.
Structure of an HTTP parser object.
Structure of an HTTP message.
size_t size
Number of urls (not characters).
Represents a list of URLs as in the "callback" header of SUBSCRIBE message in GENA.
#define X_USER_AGENT
Can be overwritten by configure CFLAGS argument.
long ListSize(LinkedList *list)
Returns the size of the list.
void * ListDelNode(LinkedList *list, ListNode *dnode, int freeItem)
Removes a node from the list. The memory for the node is freed.
ListNode * ListHead(LinkedList *list)
Returns the head of the list.
ListNode * ListAddTail(LinkedList *list, void *item)
Adds a node to the tail of the list. Node gets added immediately before list.tail.
int ListInit(LinkedList *list, cmp_routine cmp_func, free_function free_func)
Initializes LinkedList. Must be called first and only once for List.
#define EOUTOFMEM
Error condition for "out of memory".
Linked list node. Stores generic item and pointers to next and prev.
Linked list (no protection).
int ThreadPoolAdd(ThreadPool *tp, ThreadPoolJob *job, int *jobId)
Adds a job to the thread pool.
int TPJobSetFreeFunction(ThreadPoolJob *job, free_routine func)
Sets the jobs free function.
int TPJobSetPriority(ThreadPoolJob *job, ThreadPriority priority)
Sets the priority of the threadpool job.
int TPJobInit(ThreadPoolJob *job, UPnPsdk::start_routine func, void *arg)
Initializes thread pool job.
void(* free_routine)(void *arg)
hostport_type hostport
Member variable.
size_t size
Size of the buffer.
token pathquery
Member variable.
sockaddr_storage IPaddress
Network socket address.
constexpr int HTTP_SUCCESS
Yet another success code.
token text
Pointing to the full host:port string representation.
Represents a URI used in parse_uri and elsewhere.
s_UpnpSubscriptionRequest
Header file for UpnpSubscriptionRequest methods.
PUPNP_Api int UpnpSubscriptionRequest_strcpy_SID(UpnpSubscriptionRequest *p, const char *s)
PUPNP_Api UpnpSubscriptionRequest * UpnpSubscriptionRequest_new(void)
PUPNP_Api void UpnpSubscriptionRequest_delete(UpnpSubscriptionRequest *p)
PUPNP_Api int UpnpSubscriptionRequest_strcpy_UDN(UpnpSubscriptionRequest *p, const char *s)
PUPNP_Api int UpnpSubscriptionRequest_strcpy_ServiceId(UpnpSubscriptionRequest *p, const char *s)
#define GENA_NOTIFICATION_SENDING_TIMEOUT
The GENA_NOTIFICATION_SENDING_TIMEOUT specifies the number of seconds to wait for sending GENA notifi...
#define GENA_NOTIFICATION_ANSWERING_TIMEOUT
The GENA_NOTIFICATION_ANSWERING_TIMEOUT specifies the number of seconds to wait for receiving the ans...
Manage Eventing with GENA, the General Event Notification Architecture.
#define GENA_E_BAD_HANDLE
UpnpDevice_Handle device_handle
#define XML_PROPERTYSET_HEADER
#define GENA_E_NOTIFY_UNACCEPTED
#define GENA_E_NOTIFY_UNACCEPTED_REMOVE_SUB
#define MAX_CONTENT_LENGTH
#define GENA_E_BAD_SERVICE
void error_respond(SOCKINFO *info, int error_code, http_message_t *hmsg)
Sends an error message to the control point in the case of incorrect GENA requests.
void freeSubscriptionQueuedEvents(subscription *sub)
???
void gena_process_subscription_request(SOCKINFO *info, http_message_t *request)
Handles a subscription request from a ctrl point. The socket is not closed on return.
int genaNotifyAll(UpnpDevice_Handle device_handle, char *UDN, char *servId, char **VarNames, char **VarValues, int var_count)
Sends a notification to all the subscribed control points.
void gena_process_unsubscribe_request(SOCKINFO *info, http_message_t *request)
Handles a subscription cancellation request from a ctrl point. The connection is not destroyed on ret...
int genaUnregisterDevice(UpnpDevice_Handle device_handle)
Cleans the service table of the device.
void gena_process_subscription_renewal_request(SOCKINFO *info, http_message_t *request)
Handles a subscription renewal request from a ctrl point. The connection is not destroyed on return.
int gena_validate_delivery_urls(SOCKINFO *info, URL_list *url_list)
Validate that the URLs passed by the user are on the same network segment than the device.
int genaNotifyAllExt(UpnpDevice_Handle device_handle, char *UDN, char *servId, IXML_Document *PropSet)
Sends a notification to all the subscribed control points.
int genaInitNotifyExt(UpnpDevice_Handle device_handle, char *UDN, char *servId, IXML_Document *PropSet, const Upnp_SID sid)
Similar to the genaInitNofity. The only difference is that it takes the xml document for the state ta...
#define STALE_JOBID
Invalid job id.
int genaInitNotify(UpnpDevice_Handle device_handle, char *UDN, char *servId, char **VarNames, char **VarValues, int var_count, const Upnp_SID sid)
Sends the intial state table dump to newly subscribed control point.
Data structure common to all types of nodes.
Data structure representing the DOM Document.
PUPNP_Api DOMString ixmlPrintNode(IXML_Node *doc)
Renders a Node and all sub-elements into an XML text representation.
#define DOMString
The type of DOM strings.
PUPNP_Api void ixmlFreeDOMString(DOMString buf)
Frees a DOMString.
PUPNP_Api DOMString ixmlCloneDOMString(const DOMString src)
Clones an existing DOMString.
http_header_t * httpmsg_find_hdr(http_message_t *msg, int header_name_id, memptr *value)
Finds header from a list, with the given 'name_id'.
void httpmsg_destroy(http_message_t *msg)
Free memory allocated for the http message.
parse_status_t matchstr(char *str, size_t slen, const char *fmt,...)
Matches a variable parameter list with a string and takes actions based on the data type specified.
int http_SendMessage(SOCKINFO *info, int *TimeOut, const char *fmt,...)
Sends a message to the destination based on the format parameter.
SOCKET http_Connect(uri_type *destination_url, uri_type *url)
Gets destination address from URL and then connects to the remote end.
void http_CalcResponseVersion(int request_major_vers, int request_minor_vers, int *response_major_vers, int *response_minor_vers)
Calculate HTTP response versions based on the request versions.
int http_RecvMessage(SOCKINFO *info, http_parser_t *parser, http_method_t request_method, int *timeout_secs, int *http_error_code)
Get the data on the socket and take actions based on the read data to modify the parser objects buffe...
int http_MakeMessage(membuffer *buf, int http_major_version, int http_minor_version, const char *fmt,...)
Generate an HTTP message based on the format that is specified in the input parameters.
Performs HTTP read and write messages.
void membuffer_destroy(membuffer *m)
Free's memory allocated for membuffer* m.
char * str_alloc(const char *str, size_t str_len)
Allocate memory and copy information from the input string to the newly allocated memory.
void membuffer_init(membuffer *m)
Wrapper to membuffer_initialize().
int membuffer_append(membuffer *m, const void *buf, size_t buf_len)
Invokes function to appends data from a constant buffer to the buffer.
int memptr_cmp_nocase(memptr *m, const char *s)
Compares characters of 2 strings irrespective of the case for a specific count of bytes.
size_t size_inc
used to increase size; MUST be > 0; (read/write).
size_t length
length of buffer without terminating null byte (read-only).
char * buf
mem buffer; must not write beyond buf[length-1] (read/write).
size_t length
length of memory without terminating '\0' (read-only).
char * buf
start of memory (read/write).
pointer to a chunk of memory.
Maintains a block of dynamically allocated memory.
#define UPNP_E_SOCKET_CONNECT
The SDK had a problem connecting to a remote host.
#define UPNP_E_SUCCESS
The operation completed successfully.
#define UPNP_E_OUTOF_MEMORY
Not enough resources are currently available to complete the operation.
#define UPNP_E_INVALID_PARAM
One or more of the parameters passed to the function is not valid.
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 genaInitNotifyCommon(UpnpDevice_Handle device_handle, char *UDN, char *servId, DOMString propertySet, const Upnp_SID sid)
We take ownership of propertySet and will free it.
char * AllocGenaHeaders(const DOMString propertySet)
Allocates the GENA header.
void maybeDiscardEvents(LinkedList *listp)
This gets called before queuing a new event.
int genaNotify(char *headers, char *propertySet, subscription *sub)
Function to Notify a particular subscription of a particular event.
int GeneratePropertySet(char **names, char **values, int count, DOMString *out)
Generates XML property set for notifications.
int genaNotifyAllCommon(UpnpDevice_Handle device_handle, char *UDN, char *servId, DOMString propertySet)
We take ownership of propertySet and will free it.
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.
void free_notify_struct(void *input)
Frees memory used in notify_threads if the reference count is 0, otherwise decrements the refrence co...
void genaNotifyThread(void *input)
Thread job to Notify a control point.
subscription * GetFirstSubscription(service_info *service)
Gets pointer to the first subscription node in the service table.
subscription * GetSubscriptionSID(const Upnp_SID sid, service_info *service)
Return the subscription from the service table that matches const Upnp_SID sid value.
int copy_subscription(subscription *in, subscription *out)
Makes a copy of the subscription.
void freeServiceTable(service_table *table)
Free's dynamic memory in table (does not free table, only memory within the structure).
void freeSubscription(subscription *sub)
Free's the memory allocated for storing the URL of the subscription.
void RemoveSubscriptionSID(Upnp_SID sid, service_info *service)
Remove the subscription from the service table and update it.
void freeSubscriptionList(subscription *head)
Free's memory allocated for all the subscriptions in the service table.
subscription * GetNextSubscription(service_info *service, subscription *current)
Get current and valid subscription from the service table.
service_info * FindServiceId(service_table *table, const char *serviceId, const char *UDN)
Traverses through the service table to find a service.
int TotalSubscriptions
Part of Service information.
URL_list DeliveryURLs
Part of subscription.
int active
Part of subscription.
struct subscription * next
Part of subscription.
Upnp_SID sid
Part of subscription.
subscription * subscriptionList
Part of Service information.
DOMString UDN
Part of Service information.
DOMString serviceId
Part of Service information.
LinkedList outgoing
List of queued events for this subscription.
int ToSendEventKey
Part of subscription.
time_t expireTime
Part of subscription.
int active
Part of Service information.
-brief Service information
int sock_destroy(SOCKINFO *info, int ShutdownMethod)
Shutsdown the socket using the ShutdownMethod to indicate whether sends and receives on the socket wi...
int sock_init(SOCKINFO *info, SOCKET sockfd)
Assign the passed in socket descriptor to socket descriptor in the SOCKINFO structure.
sockaddr_storage foreign_sockaddr
Socket address of the remote node only filled in incoming requests.
Additional socket information for connections and ssl.
Manage "Step 1: Discovery" of the UPnP+™ specification with SSDP.
Unix-specific network utilities.
unsigned gIF_IPV6_ULA_GUA_PREFIX_LENGTH
IPv6 GUA prefix length. (extern'ed in upnp.h)
Upnp_Handle_Type GetHandleInfo(UpnpClient_Handle Hnd, Handle_Info **HndInfo)
Get handle information.
ThreadPool gSendThreadPool
Send thread pool.
char gIF_IPV6_ULA_GUA[INET6_ADDRSTRLEN]
IPv6 GUA buffer to contain interface IPv6 global-unicast address.
Upnp_Handle_Type GetDeviceHandleInfoForPath(const char *path, int AddressFamily, UpnpDevice_Handle *device_handle_out, struct Handle_Info **HndInfo, service_info **serv_info)
Retrieves the device handle and information of the first device of the address family specified,...
unsigned gIF_IPV6_PREFIX_LENGTH
IPv6 LLA prefix length. (extern'ed in upnp.h)
int g_UpnpSdkEQMaxLen
Global variable to determines the maximum number of events.
char gIF_IPV4[INET_ADDRSTRLEN]
IPv4 buffer to contain interface address. (extern'ed in upnp.h)
char gIF_IPV4_NETMASK[INET_ADDRSTRLEN]
IPv4 buffer to contain interface netmask. (extern'ed in upnp.h)
int g_UpnpSdkEQMaxAge
Global variable to determine the maximum number of seconds which an event can spend on a subscription...
char gIF_IPV6[INET6_ADDRSTRLEN]
IPv6 LLA buffer to contain interface address. (extern'ed in upnp.h)
Inititalize the compatible library before it can be used.
#define HandleLock()
HandleLock.
service_table ServiceTable
Table holding subscriptions and URL information.
#define UPNP_TIMEOUT
UPNP_TIMEOUT.
#define HandleUnlock()
HandleUnlock.
Upnp_FunPtr Callback
Callback function pointer.
int MaxSubscriptionTimeOut
???
Data to be stored in handle table for Handle Info.
UPnPsdk_VIS void UpnpPrintf(Upnp_LogLevel DLevel, Dbg_Module Module, const char *DbgFileName, int DbgLineNo, const char *FmtStr,...)
Prints the debug statement.
void upnp_uuid_unpack(uuid_upnp *u, char *out)
Unpack a UUID.
int uuid_create(uuid_upnp *uid)
Generate a UUID.