UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
upnptools.cpp
Go to the documentation of this file.
1/**************************************************************************
2 *
3 * Copyright (c) 2000-2003 Intel Corporation
4 * All rights reserved.
5 * Copyright (c) 2012 France Telecom All rights reserved.
6 * Copyright (C) 2022+ GPL 3 and higher by Ingo Höft, <Ingo@Hoeft-online.de>
7 * Redistribution only with this Copyright remark. Last modified: 2024-10-26
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * - Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 * - Redistributions in binary form must reproduce the above copyright notice,
15 * this list of conditions and the following disclaimer in the documentation
16 * and/or other materials provided with the distribution.
17 * - Neither name of Intel Corporation nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
25 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
29 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 **************************************************************************/
34// Last compare with ./Pupnp source file on 2024-10-26, ver 1.14.20
41#include <upnp.hpp>
42#include <upnptools.hpp>
43
44#include <ThreadPool.hpp>
45
46#include <uri.hpp>
47
48#include <stdarg.h>
49#include <stdio.h>
50
52constexpr int HEADER_LENGTH{2000};
53
60 int rc;
62 const char* rcError;
63};
64
69 {UPNP_E_SUCCESS, "UPNP_E_SUCCESS"},
70 {UPNP_E_INVALID_HANDLE, "UPNP_E_INVALID_HANDLE"},
71 {UPNP_E_INVALID_PARAM, "UPNP_E_INVALID_PARAM"},
72 {UPNP_E_OUTOF_HANDLE, "UPNP_E_OUTOF_HANDLE"},
73 {UPNP_E_OUTOF_CONTEXT, "UPNP_E_OUTOF_CONTEXT"},
74 {UPNP_E_OUTOF_MEMORY, "UPNP_E_OUTOF_MEMORY"},
75 {UPNP_E_INIT, "UPNP_E_INIT"},
76 {UPNP_E_BUFFER_TOO_SMALL, "UPNP_E_BUFFER_TOO_SMALL"},
77 {UPNP_E_INVALID_DESC, "UPNP_E_INVALID_DESC"},
78 {UPNP_E_INVALID_URL, "UPNP_E_INVALID_URL"},
79 {UPNP_E_INVALID_SID, "UPNP_E_INVALID_SID"},
80 {UPNP_E_INVALID_DEVICE, "UPNP_E_INVALID_DEVICE"},
81 {UPNP_E_INVALID_SERVICE, "UPNP_E_INVALID_SERVICE"},
82 {UPNP_E_BAD_RESPONSE, "UPNP_E_BAD_RESPONSE"},
83 {UPNP_E_BAD_REQUEST, "UPNP_E_BAD_REQUEST"},
84 {UPNP_E_INVALID_ACTION, "UPNP_E_INVALID_ACTION"},
85 {UPNP_E_FINISH, "UPNP_E_FINISH"},
86 {UPNP_E_INIT_FAILED, "UPNP_E_INIT_FAILED"},
87 {UPNP_E_URL_TOO_BIG, "UPNP_E_URL_TOO_BIG"},
88 {UPNP_E_BAD_HTTPMSG, "UPNP_E_BAD_HTTPMSG"},
89 {UPNP_E_ALREADY_REGISTERED, "UPNP_E_ALREADY_REGISTERED"},
90 {UPNP_E_INVALID_INTERFACE, "UPNP_E_INVALID_INTERFACE"},
91 {UPNP_E_NETWORK_ERROR, "UPNP_E_NETWORK_ERROR"},
92 {UPNP_E_SOCKET_WRITE, "UPNP_E_SOCKET_WRITE"},
93 {UPNP_E_SOCKET_READ, "UPNP_E_SOCKET_READ"},
94 {UPNP_E_SOCKET_BIND, "UPNP_E_SOCKET_BIND"},
95 {UPNP_E_SOCKET_CONNECT, "UPNP_E_SOCKET_CONNECT"},
96 {UPNP_E_OUTOF_SOCKET, "UPNP_E_OUTOF_SOCKET"},
97 {UPNP_E_LISTEN, "UPNP_E_LISTEN"},
98 {UPNP_E_TIMEDOUT, "UPNP_E_TIMEDOUT"},
99 {UPNP_E_SOCKET_ERROR, "UPNP_E_SOCKET_ERROR"},
100 {UPNP_E_FILE_WRITE_ERROR, "UPNP_E_FILE_WRITE_ERROR"},
101 {UPNP_E_CANCELED, "UPNP_E_CANCELED"},
102 {UPNP_E_EVENT_PROTOCOL, "UPNP_E_EVENT_PROTOCOL"},
103 {UPNP_E_SUBSCRIBE_UNACCEPTED, "UPNP_E_SUBSCRIBE_UNACCEPTED"},
104 {UPNP_E_UNSUBSCRIBE_UNACCEPTED, "UPNP_E_UNSUBSCRIBE_UNACCEPTED"},
105 {UPNP_E_NOTIFY_UNACCEPTED, "UPNP_E_NOTIFY_UNACCEPTED"},
106 {UPNP_E_INVALID_ARGUMENT, "UPNP_E_INVALID_ARGUMENT"},
107 {UPNP_E_FILE_NOT_FOUND, "UPNP_E_FILE_NOT_FOUND"},
108 {UPNP_E_FILE_READ_ERROR, "UPNP_E_FILE_READ_ERROR"},
109 {UPNP_E_EXT_NOT_XML, "UPNP_E_EXT_NOT_XML"},
110 {UPNP_E_NO_WEB_SERVER, "UPNP_E_NO_WEB_SERVER"},
111 {UPNP_E_OUTOF_BOUNDS, "UPNP_E_OUTOF_BOUNDS"},
112 {UPNP_E_NOT_FOUND, "UPNP_E_NOT_FOUND"},
113 {UPNP_E_INTERNAL_ERROR, "UPNP_E_INTERNAL_ERROR"},
114};
115
116const char* UpnpGetErrorMessage(int rc) {
117 size_t i;
118
119 for (i = 0; i < sizeof(ErrorMessages) / sizeof(ErrorMessages[0]); ++i) {
120 if (rc == ErrorMessages[i].rc) {
121 return ErrorMessages[i].rcError;
122 }
123 }
124
125 return "Unknown error code";
126}
127
129
135int UpnpResolveURL(const char* BaseURL, const char* RelURL, char* AbsURL) {
136 int ret = UPNP_E_SUCCESS;
137 char* tempRel = NULL;
138
139 if (!RelURL) {
141 goto ExitFunction;
142 }
143 tempRel = resolve_rel_url((char*)BaseURL, (char*)RelURL);
144 if (tempRel) {
145 strcpy(AbsURL, tempRel);
146 free(tempRel);
147 } else
148 ret = UPNP_E_INVALID_URL;
149
150ExitFunction:
151 return ret;
152}
153
154int UpnpResolveURL2(const char* BaseURL, const char* RelURL, char** AbsURL) {
155 int ret = UPNP_E_SUCCESS;
156
157 if (!RelURL) {
159 goto ExitFunction;
160 }
161 *AbsURL = resolve_rel_url((char*)BaseURL, (char*)RelURL);
162 if (!*AbsURL)
163 ret = UPNP_E_INVALID_URL;
164
165ExitFunction:
166 return ret;
167}
168
177static int addToAction(
179 int response,
181 IXML_Document** ActionDoc,
183 const char* ActionName,
185 const char* ServType,
187 const char* ArgName,
189 const char* ArgValue) {
190 char* ActBuff = NULL;
191 IXML_Node* node = NULL;
192 IXML_Element* Ele = NULL;
193 IXML_Node* Txt = NULL;
194 int rc = 0;
195
196 if (ActionName == NULL || ServType == NULL) {
198 }
199
200 if (*ActionDoc == NULL) {
201 ActBuff = (char*)malloc(HEADER_LENGTH);
202 if (ActBuff == NULL) {
203 return UPNP_E_OUTOF_MEMORY;
204 }
205
206 if (response) {
207 rc = snprintf(ActBuff, HEADER_LENGTH,
208 "<u:%sResponse "
209 "xmlns:u=\"%s\">\r\n</u:%sResponse>",
210 ActionName, ServType, ActionName);
211 } else {
212 rc = snprintf(ActBuff, HEADER_LENGTH,
213 "<u:%s xmlns:u=\"%s\">\r\n</u:%s>", ActionName,
214 ServType, ActionName);
215 }
216 if (rc < 0 || (unsigned int)rc >= HEADER_LENGTH) {
217 free(ActBuff);
218 return UPNP_E_OUTOF_MEMORY;
219 }
220
221 rc = ixmlParseBufferEx(ActBuff, ActionDoc);
222 free(ActBuff);
223 if (rc != IXML_SUCCESS) {
224 if (rc == IXML_INSUFFICIENT_MEMORY) {
225 return UPNP_E_OUTOF_MEMORY;
226 } else {
227 return UPNP_E_INVALID_DESC;
228 }
229 }
230 }
231
232 if (ArgName != NULL /*&& ArgValue != NULL */) {
233 node = ixmlNode_getFirstChild((IXML_Node*)*ActionDoc);
234 Ele = ixmlDocument_createElement(*ActionDoc, ArgName);
235 if (ArgValue) {
236 Txt = ixmlDocument_createTextNode(*ActionDoc, ArgValue);
238 }
239 ixmlNode_appendChild(node, (IXML_Node*)Ele);
240 }
241
242 return UPNP_E_SUCCESS;
243}
244
253 int response,
255 const char* ActionName,
257 const char* ServType,
259 int NumArg,
261 const char* Arg,
263 va_list ArgList) {
264 const char* ArgName;
265 const char* ArgValue;
266 char* ActBuff;
267 int Idx = 0;
268 IXML_Document* ActionDoc;
269 IXML_Node* node;
270 IXML_Element* Ele;
271 IXML_Node* Txt = NULL;
272 int rc = 0;
273
274 if (ActionName == NULL || ServType == NULL) {
275 return NULL;
276 }
277
278 ActBuff = (char*)malloc(HEADER_LENGTH);
279 if (ActBuff == NULL) {
280 return NULL;
281 }
282
283 if (response) {
284 rc = snprintf(ActBuff, HEADER_LENGTH,
285 "<u:%sResponse xmlns:u=\"%s\">\r\n</u:%sResponse>",
286 ActionName, ServType, ActionName);
287 } else {
288 rc =
289 snprintf(ActBuff, HEADER_LENGTH, "<u:%s xmlns:u=\"%s\">\r\n</u:%s>",
290 ActionName, ServType, ActionName);
291 }
292 if (rc < 0 || (unsigned int)rc >= HEADER_LENGTH ||
293 ixmlParseBufferEx(ActBuff, &ActionDoc) != IXML_SUCCESS) {
294 free(ActBuff);
295 return NULL;
296 }
297
298 free(ActBuff);
299 if (ActionDoc == NULL) {
300 return NULL;
301 }
302
303 if (NumArg > 0) {
304 /*va_start(ArgList, Arg); */
305 ArgName = Arg;
306 for (;;) {
307 ArgValue = va_arg(ArgList, const char*);
308 if (ArgName != NULL) {
309 node = ixmlNode_getFirstChild((IXML_Node*)ActionDoc);
310 Ele = ixmlDocument_createElement(ActionDoc, ArgName);
311 if (ArgValue) {
312 Txt = ixmlDocument_createTextNode(ActionDoc, ArgValue);
314 }
315 ixmlNode_appendChild(node, (IXML_Node*)Ele);
316 }
317 if (++Idx < NumArg) {
318 ArgName = va_arg(ArgList, const char*);
319 } else {
320 break;
321 }
322 }
323 /*va_end(ArgList); */
324 }
325
326 return ActionDoc;
327}
328
329IXML_Document* UpnpMakeAction(const char* ActionName, const char* ServType,
330 int NumArg, const char* Arg, ...) {
331 va_list ArgList;
332 IXML_Document* out = NULL;
333
334 va_start(ArgList, Arg);
335 out = makeAction(0, ActionName, ServType, NumArg, Arg, ArgList);
336 va_end(ArgList);
337
338 return out;
339}
340
341IXML_Document* UpnpMakeActionResponse(const char* ActionName,
342 const char* ServType, int NumArg,
343 const char* Arg, ...) {
344 va_list ArgList;
345 IXML_Document* out = NULL;
346
347 va_start(ArgList, Arg);
348 out = makeAction(1, ActionName, ServType, NumArg, Arg, ArgList);
349 va_end(ArgList);
350
351 return out;
352}
353
354int UpnpAddToAction(IXML_Document** ActionDoc, const char* ActionName,
355 const char* ServType, const char* ArgName,
356 const char* ArgValue) {
357 return addToAction(0, ActionDoc, ActionName, ServType, ArgName, ArgValue);
358}
359
361 const char* ActionName, const char* ServType,
362 const char* ArgName, const char* ArgValue) {
363 return addToAction(1, ActionResponse, ActionName, ServType, ArgName,
364 ArgValue);
365}
366
367IXML_Document* UpnpCreatePropertySet(int NumArg, const char* Arg, ...) {
368 va_list ArgList;
369 int Idx = 0;
370 char BlankDoc[] =
371 "<e:propertyset xmlns:e=\"urn:schemas-upnp-org:event-1-0\">"
372 "</e:propertyset>";
373 const char *ArgName, *ArgValue;
374 IXML_Node* node;
375 IXML_Element* Ele;
376 IXML_Element* Ele1;
377 IXML_Node* Txt;
378 IXML_Document* PropSet;
379
380 if (ixmlParseBufferEx(BlankDoc, &PropSet) != IXML_SUCCESS) {
381 return NULL;
382 }
383
384 if (NumArg < 1) {
385 return PropSet;
386 }
387
388 va_start(ArgList, Arg);
389 ArgName = Arg;
390 while (Idx++ != NumArg) {
391 ArgValue = va_arg(ArgList, const char*);
392 if (ArgName != NULL /*&& ArgValue != NULL */) {
393 node = ixmlNode_getFirstChild((IXML_Node*)PropSet);
394 Ele1 = ixmlDocument_createElement(PropSet, "e:property");
395 Ele = ixmlDocument_createElement(PropSet, ArgName);
396 if (ArgValue) {
397 Txt = ixmlDocument_createTextNode(PropSet, ArgValue);
399 }
401 ixmlNode_appendChild(node, (IXML_Node*)Ele1);
402 }
403 ArgName = va_arg(ArgList, const char*);
404 }
405 va_end(ArgList);
406
407 return PropSet;
408}
409
410int UpnpAddToPropertySet(IXML_Document** PropSet, const char* ArgName,
411 const char* ArgValue) {
412 char BlankDoc[] =
413 "<e:propertyset xmlns:e=\"urn:schemas-upnp-org:event-1-0\">"
414 "</e:propertyset>";
415 IXML_Node* node;
416 IXML_Element* Ele;
417 IXML_Element* Ele1;
418 IXML_Node* Txt;
419 int rc;
420
421 if (ArgName == NULL) {
423 }
424
425 if (*PropSet == NULL) {
426 rc = ixmlParseBufferEx(BlankDoc, PropSet);
427 if (rc != IXML_SUCCESS) {
428 return UPNP_E_OUTOF_MEMORY;
429 }
430 }
431
432 node = ixmlNode_getFirstChild((IXML_Node*)*PropSet);
433
434 Ele1 = ixmlDocument_createElement(*PropSet, "e:property");
435 Ele = ixmlDocument_createElement(*PropSet, ArgName);
436
437 if (ArgValue) {
438 Txt = ixmlDocument_createTextNode(*PropSet, ArgValue);
440 }
441
443 ixmlNode_appendChild(node, (IXML_Node*)Ele1);
444
445 return UPNP_E_SUCCESS;
446}
#define UPNP_E_INVALID_DEVICE
The operation completed successfully.
Definition API.hpp:135
#define UPNP_E_FILE_WRITE_ERROR
The operation completed successfully.
Definition API.hpp:293
#define UPNP_E_INVALID_SID
The operation completed successfully.
Definition API.hpp:133
#define UPNP_E_NO_WEB_SERVER
The operation completed successfully.
Definition API.hpp:354
#define UPNP_E_BAD_REQUEST
The operation completed successfully.
Definition API.hpp:153
#define UPNP_E_OUTOF_BOUNDS
The operation completed successfully.
Definition API.hpp:355
#define UPNP_E_OUTOF_CONTEXT
The operation completed successfully.
Definition API.hpp:97
#define UPNP_E_EVENT_PROTOCOL
The operation completed successfully.
Definition API.hpp:312
#define UPNP_E_BUFFER_TOO_SMALL
The operation completed successfully.
Definition API.hpp:115
const char * rcError
Definition upnptools.cpp:62
struct ErrorString ErrorMessages[]
Array of error structures.
Definition upnptools.cpp:68
static IXML_Document * makeAction(int response, const char *ActionName, const char *ServType, int NumArg, const char *Arg, va_list ArgList)
Creates the action request or response from the argument list.
constexpr int HEADER_LENGTH
Definition upnptools.cpp:52
static int addToAction(int response, IXML_Document **ActionDoc, const char *ActionName, const char *ServType, const char *ArgName, const char *ArgValue)
Adds the argument in the action request or response.
Structure to maintain a error code and string associated with the error code.
Definition upnptools.cpp:58
void TPSetMaxJobsTotal(int mjt)
Sets the maximum number of jobs in the thread pool.
Manage a threadpool (for internal use only).
IXML_Document * UpnpMakeAction(const char *ActionName, const char *ServType, int NumArg, const char *Arg,...)
Creates an action request packet based on its input parameters (status variable name and value pair).
int UpnpAddToAction(IXML_Document **ActionDoc, const char *ActionName, const char *ServType, const char *ArgName, const char *ArgValue)
Adds the argument in the action request.
IXML_Document * UpnpMakeActionResponse(const char *ActionName, const char *ServType, int NumArg, const char *Arg,...)
Ceates an action response packet based on its output parameters (status variable name and value pair)...
int UpnpAddToPropertySet(IXML_Document **PropSet, const char *ArgName, const char *ArgValue)
Can be used when an application needs to transfer the status of many variables at once.
int UpnpResolveURL(const char *BaseURL, const char *RelURL, char *AbsURL)
Combines a base URL and a relative URL into a single absolute URL.
int UpnpResolveURL2(const char *BaseURL, const char *RelURL, char **AbsURL)
Combines a base URL and a relative URL into a single absolute URL.
IXML_Document * UpnpCreatePropertySet(int NumArg, const char *Arg,...)
Creates a property set message packet.
int UpnpAddToActionResponse(IXML_Document **ActionResponse, const char *ActionName, const char *ServType, const char *ArgName, const char *ArgValue)
Creates an action response packet based on its output parameters (status variable name and value pair...
void UpnpSetMaxJobsTotal(int mjt)
Sets the maximum number of jobs in the internal thread pool.
const char * UpnpGetErrorMessage(int rc)
Converts an SDK error code into a string error message suitable for display. The memory returned from...
Data structure common to all types of nodes.
Definition ixml.hpp:132
Data structure representing an Element node.
Definition ixml.hpp:169
Data structure representing the DOM Document.
Definition ixml.hpp:155
PUPNP_Api int ixmlNode_appendChild(IXML_Node *nodeptr, IXML_Node *newChild)
Appends a child Node to the list of children of a Node.
Definition node.cpp:611
PUPNP_Api int ixmlParseBufferEx(const char *buffer, IXML_Document **doc)
Parses an XML text buffer converting it into an IXML DOM representation.
Definition ixml.cpp:390
PUPNP_Api IXML_Element * ixmlDocument_createElement(IXML_Document *doc, const DOMString tagName)
Creates a new Element node with the given tag name.
Definition document.cpp:141
PUPNP_Api IXML_Node * ixmlDocument_createTextNode(IXML_Document *doc, const DOMString data)
Creates a new Text node with the given data.
Definition document.cpp:237
PUPNP_Api IXML_Node * ixmlNode_getFirstChild(IXML_Node *nodeptr)
Retrieves the first child Node of a Node.
Definition node.cpp:342
#define UPNP_E_SOCKET_CONNECT
The SDK had a problem connecting to a remote host.
Definition messages.hpp:209
#define UPNP_E_OUTOF_HANDLE
The SDK does not have any more space for additional handles.
Definition messages.hpp:47
#define UPNP_E_ALREADY_REGISTERED
A client or a device is already registered.
Definition messages.hpp:154
#define UPNP_E_NOT_FOUND
The response to a SOAP request did not contain the required XML constructs.
Definition messages.hpp:313
#define UPNP_E_SOCKET_ERROR
Generic socket error code for conditions not covered by other error codes.
Definition messages.hpp:243
#define UPNP_E_LISTEN
The SDK had a problem setting the socket to listen for incoming connections.
Definition messages.hpp:227
#define UPNP_E_NETWORK_ERROR
A network error occurred.
Definition messages.hpp:169
#define UPNP_E_SOCKET_BIND
The SDK had a problem binding a socket to a network interface.
Definition messages.hpp:199
#define UPNP_E_INVALID_ARGUMENT
One or more of the parameters passed to a function is invalid.
Definition messages.hpp:287
#define UPNP_E_INVALID_HANDLE
The handle passed to a function is not a recognized as a valid handle.
Definition messages.hpp:32
#define UPNP_E_TIMEDOUT
Too much time elapsed before the required number of bytes were sent or received over a socket.
Definition messages.hpp:235
#define UPNP_E_FILE_READ_ERROR
An error happened while reading a file.
Definition messages.hpp:298
#define UPNP_E_INVALID_INTERFACE
The interface provided to UpnpInit2 is unknown or does not have a valid IPv4 or IPv6 address configur...
Definition messages.hpp:160
#define UPNP_E_BAD_HTTPMSG
The HTTP message contains invalid message headers.
Definition messages.hpp:146
#define UPNP_E_FILE_NOT_FOUND
The filename passed to one of the device registration functions was not found or was not accessible.
Definition messages.hpp:293
#define UPNP_E_SUCCESS
The operation completed successfully.
Definition messages.hpp:27
#define UPNP_E_SUBSCRIBE_UNACCEPTED
A subscription request was rejected from the remote side.
Definition messages.hpp:269
#define UPNP_E_OUTOF_SOCKET
The SDK cannot create any more sockets.
Definition messages.hpp:219
#define UPNP_E_OUTOF_MEMORY
Not enough resources are currently available to complete the operation.
Definition messages.hpp:57
#define UPNP_E_INVALID_URL
An URL passed into the function is invalid.
Definition messages.hpp:83
#define UPNP_E_INVALID_ACTION
The SOAP action message is invalid.
Definition messages.hpp:113
#define UPNP_E_SOCKET_WRITE
An error happened while writing to a socket.
Definition messages.hpp:179
#define UPNP_E_FINISH
UpnpInit2 has not been called, or UpnpFinish has already been called.
Definition messages.hpp:121
#define UPNP_E_INIT_FAILED
UpnpInit2 cannot complete.
Definition messages.hpp:128
#define UPNP_E_UNSUBSCRIBE_UNACCEPTED
An unsubscribe request was rejected from the remote side.
Definition messages.hpp:274
#define UPNP_E_NOTIFY_UNACCEPTED
The remote host did not accept the notify sent from the local device.
Definition messages.hpp:279
#define UPNP_E_CANCELED
The operation was canceled.
Definition messages.hpp:252
#define UPNP_E_SOCKET_READ
An error happened while reading from a socket.
Definition messages.hpp:189
#define UPNP_E_INVALID_SERVICE
The device ID/service ID pair does not refer to a valid service.
Definition messages.hpp:95
#define UPNP_E_INVALID_DESC
The description document passed to UpnpRegisterRootDevice, UpnpRegisterRootDevice2 UpnpRegisterRootDe...
Definition messages.hpp:74
#define UPNP_E_INVALID_PARAM
One or more of the parameters passed to the function is not valid.
Definition messages.hpp:40
#define UPNP_E_URL_TOO_BIG
The URL passed into a function is too long.
Definition messages.hpp:135
#define UPNP_E_INTERNAL_ERROR
Generic error code for internal conditions not covered by other error codes.
Definition messages.hpp:319
#define UPNP_E_BAD_RESPONSE
The response received from the remote side of a connection is not correct for the protocol.
Definition messages.hpp:103
#define UPNP_E_INIT
The SDK has already been initialized.
Definition messages.hpp:65
#define UPNP_E_EXT_NOT_XML
The file name of the description document passed to UpnpRegisterRootDevice2 does not end in "....
Definition messages.hpp:304
char * resolve_rel_url(char *base_url, char *rel_url)
Resolves a relative url with a base url.
Definition uri.cpp:605