|
libUPnP
1.8.4
|
#include "ixml.h"#include "upnpconfig.h"#include "UpnpGlobal.h"#include "UpnpInet.h"#include "ActionComplete.h"#include "ActionRequest.h"#include "Discovery.h"#include "Event.h"#include "EventSubscribe.h"#include "FileInfo.h"#include "StateVarComplete.h"#include "StateVarRequest.h"#include "SubscriptionRequest.h"#include "Callback.h"

Go to the source code of this file.
Macros | |
| #define | LINE_SIZE (size_t)180 |
| #define | NAME_SIZE (size_t)256 |
| #define | MNFT_NAME_SIZE 64 |
| #define | MODL_NAME_SIZE 32 |
| #define | SERL_NUMR_SIZE 64 |
| #define | MODL_DESC_SIZE 64 |
| #define | UPNP_INFINITE -1 |
| #define | UPNP_USING_CHUNKED -3 |
| #define | UPNP_UNTIL_CLOSE -4 |
Error codes | |
The functions in the SDK API can return a variety of error codes to describe problems encountered during execution. This section lists the error codes and provides a brief description of what each error code means. Refer to the documentation for each function for a description of what an error code means in that context. | |
| #define | UPNP_E_SUCCESS 0 |
| The operation completed successfully. More... | |
| #define | UPNP_E_INVALID_HANDLE -100 |
| The handle passed to a function is not a recognized as a valid handle. More... | |
| #define | UPNP_E_INVALID_PARAM -101 |
| One or more of the parameters passed to the function is not valid. More... | |
| #define | UPNP_E_OUTOF_HANDLE -102 |
| The SDK does not have any more space for additional handles. More... | |
| #define | UPNP_E_OUTOF_CONTEXT -103 |
| #define | UPNP_E_OUTOF_MEMORY -104 |
| Not enough resources are currently available to complete the operation. More... | |
| #define | UPNP_E_INIT -105 |
| The SDK has already been initialized. More... | |
| #define | UPNP_E_BUFFER_TOO_SMALL -106 |
| #define | UPNP_E_INVALID_DESC -107 |
| The description document passed to UpnpRegisterRootDevice, UpnpRegisterRootDevice2 UpnpRegisterRootDevice3 or UpnpRegisterRootDevice4 is invalid. More... | |
| #define | UPNP_E_INVALID_URL -108 |
| An URL passed into the function is invalid. More... | |
| #define | UPNP_E_INVALID_SID -109 |
| #define | UPNP_E_INVALID_DEVICE -110 |
| #define | UPNP_E_INVALID_SERVICE -111 |
| The device ID/service ID pair does not refer to a valid service. More... | |
| #define | UPNP_E_BAD_RESPONSE -113 |
| The response received from the remote side of a connection is not correct for the protocol. More... | |
| #define | UPNP_E_BAD_REQUEST -114 |
| #define | UPNP_E_INVALID_ACTION -115 |
| The SOAP action message is invalid. More... | |
| #define | UPNP_E_FINISH -116 |
| UpnpInit has not been called, or UpnpFinish has already been called. More... | |
| #define | UPNP_E_INIT_FAILED -117 |
| UpnpInit cannot complete. More... | |
| #define | UPNP_E_URL_TOO_BIG -118 |
| The URL passed into a function is too long. More... | |
| #define | UPNP_E_BAD_HTTPMSG -119 |
| The HTTP message contains invalid message headers. More... | |
| #define | UPNP_E_ALREADY_REGISTERED -120 |
| A client or a device is already registered. More... | |
| #define | UPNP_E_INVALID_INTERFACE -121 |
| The interface provided to UpnpInit2 is unknown or does not have a valid IPv4 or IPv6 address configured. More... | |
| #define | UPNP_E_NETWORK_ERROR -200 |
| A network error occurred. More... | |
| #define | UPNP_E_SOCKET_WRITE -201 |
| An error happened while writing to a socket. More... | |
| #define | UPNP_E_SOCKET_READ -202 |
| An error happened while reading from a socket. More... | |
| #define | UPNP_E_SOCKET_BIND -203 |
| The SDK had a problem binding a socket to a network interface. More... | |
| #define | UPNP_E_SOCKET_CONNECT -204 |
| The SDK had a problem connecting to a remote host. More... | |
| #define | UPNP_E_OUTOF_SOCKET -205 |
| The SDK cannot create any more sockets. More... | |
| #define | UPNP_E_LISTEN -206 |
| The SDK had a problem setting the socket to listen for incoming connections. More... | |
| #define | UPNP_E_TIMEDOUT -207 |
| Too much time elapsed before the required number of bytes were sent or received over a socket. More... | |
| #define | UPNP_E_SOCKET_ERROR -208 |
| Generic socket error code for conditions not covered by other error codes. More... | |
| #define | UPNP_E_FILE_WRITE_ERROR -209 |
| #define | UPNP_E_CANCELED -210 |
| The operation was canceled. More... | |
| #define | UPNP_E_EVENT_PROTOCOL -300 |
| #define | UPNP_E_SUBSCRIBE_UNACCEPTED -301 |
| A subscription request was rejected from the remote side. More... | |
| #define | UPNP_E_UNSUBSCRIBE_UNACCEPTED -302 |
| An unsubscribe request was rejected from the remote side. More... | |
| #define | UPNP_E_NOTIFY_UNACCEPTED -303 |
| The remote host did not accept the notify sent from the local device. More... | |
| #define | UPNP_E_INVALID_ARGUMENT -501 |
| One or more of the parameters passed to a function is invalid. More... | |
| #define | UPNP_E_FILE_NOT_FOUND -502 |
| The filename passed to one of the device registration functions was not found or was not accessible. More... | |
| #define | UPNP_E_FILE_READ_ERROR -503 |
| An error happened while reading a file. More... | |
| #define | UPNP_E_EXT_NOT_XML -504 |
| The file name of the description document passed to UpnpRegisterRootDevice2 does not end in ".xml". More... | |
| #define | UPNP_E_NO_WEB_SERVER -505 |
| #define | UPNP_E_OUTOF_BOUNDS -506 |
| #define | UPNP_E_NOT_FOUND -507 |
| The response to a SOAP request did not contain the required XML constructs. More... | |
| #define | UPNP_E_INTERNAL_ERROR -911 |
| Generic error code for internal conditions not covered by other error codes. More... | |
| #define | UPNP_SOAP_E_INVALID_ACTION 401 |
| #define | UPNP_SOAP_E_INVALID_ARGS 402 |
| #define | UPNP_SOAP_E_OUT_OF_SYNC 403 |
| #define | UPNP_SOAP_E_INVALID_VAR 404 |
| #define | UPNP_SOAP_E_ACTION_FAILED 501 |
Constants and Types | |
| enum | UpnpOpenFileMode { UPNP_READ, UPNP_WRITE } |
| enum | Upnp_SType_e { UPNP_S_ALL, UPNP_S_ROOT, UPNP_S_DEVICE, UPNP_S_SERVICE } |
| Represents the different types of searches that can be performed using the SDK for UPnP Devices API. More... | |
| enum | Upnp_DescType_e { UPNPREG_URL_DESC, UPNPREG_FILENAME_DESC, UPNPREG_BUF_DESC } |
| Specifies the type of description in UpnpRegisterRootDevice2. More... | |
| typedef int | UpnpClient_Handle |
| Returned when a control point application registers with UpnpRegisterClient. More... | |
| typedef int | UpnpDevice_Handle |
| Returned when a device application registers with UpnpRegisterRootDevice, UpnpRegisterRootDevice2, UpnpRegisterRootDevice3 or UpnpRegisterRootDevice4. More... | |
| typedef char | Upnp_SID[44] |
| Holds the subscription identifier for a subscription between a client and a device. More... | |
| typedef enum Upnp_SType_e | Upnp_SType |
| typedef enum Upnp_DescType_e | Upnp_DescType |
Control Point HTTP API | |
| enum | Upnp_HttpMethod_e { UPNP_HTTPMETHOD_PUT = 0, UPNP_HTTPMETHOD_DELETE = 1, UPNP_HTTPMETHOD_GET = 2, UPNP_HTTPMETHOD_HEAD = 3, UPNP_HTTPMETHOD_POST = 4 } |
| Different HTTP methods. More... | |
| typedef enum Upnp_HttpMethod_e | Upnp_HttpMethod |
| int | UpnpDownloadUrlItem (const char *url, char **outBuf, char *contentType) |
| Downloads a file specified in a URL. More... | |
| int | UpnpOpenHttpGet (const char *url, void **handle, char **contentType, int *contentLength, int *httpStatus, int timeout) |
| Gets a file specified in a URL. More... | |
| int | UpnpOpenHttpGetProxy (const char *url, const char *proxy_str, void **handle, char **contentType, int *contentLength, int *httpStatus, int timeout) |
| Gets a file specified in a URL through the specified proxy. More... | |
| int | UpnpOpenHttpGetEx (const char *url, void **handle, char **contentType, int *contentLength, int *httpStatus, int lowRange, int highRange, int timeout) |
| Gets specified number of bytes from a file specified in the URL. More... | |
| int | UpnpReadHttpGet (void *handle, char *buf, size_t *size, int timeout) |
| Gets specified number of bytes from a file specified in a URL. More... | |
| int | UpnpHttpGetProgress (void *handle, size_t *length, size_t *total) |
| Retrieve progress information of a http-get transfer. More... | |
| int | UpnpCancelHttpGet (void *handle) |
| Set the cancel flag of the handle parameter. More... | |
| int | UpnpCloseHttpGet (void *handle) |
| Closes the connection and frees memory that was allocated for the handle parameter. More... | |
| int | UpnpOpenHttpPost (const char *url, void **handle, const char *contentType, int contentLength, int timeout) |
| Makes an HTTP POST request message, opens a connection to the server and sends the POST request to the server if the connection to the server succeeds. More... | |
| int | UpnpWriteHttpPost (void *handle, char *buf, size_t *size, int timeout) |
| Sends a request to a server to copy the contents of a buffer to the URI specified in the UpnpOpenHttpPost call. More... | |
| int | UpnpCloseHttpPost (void *handle, int *httpStatus, int timeout) |
| Sends and receives any pending data, closes the connection with the server, and frees memory allocated during the UpnpOpenHttpPost call. More... | |
| int | UpnpOpenHttpConnection (const char *url, void **handle, int timeout) |
| Opens a connection to the server. More... | |
| int | UpnpMakeHttpRequest (Upnp_HttpMethod method, const char *url, void *handle, UpnpString *headers, const char *contentType, int contentLength, int timeout) |
| Makes a HTTP request using a connection previously created by UpnpOpenHttpConnection. More... | |
| int | UpnpWriteHttpRequest (void *handle, char *buf, size_t *size, int timeout) |
| Writes the content of a HTTP request initiated by a UpnpMakeHttpRequest call. The end of the content should be indicated by a call to UpnpEndHttpRequest. More... | |
| int | UpnpEndHttpRequest (void *handle, int timeout) |
| Indicates the end of a HTTP request previously made by UpnpMakeHttpRequest. More... | |
| int | UpnpGetHttpResponse (void *handle, UpnpString *headers, char **contentType, int *contentLength, int *httpStatus, int timeout) |
| Gets the response from the server using a connection previously created by UpnpOpenHttpConnection. More... | |
| int | UpnpReadHttpResponse (void *handle, char *buf, size_t *size, int timeout) |
| Reads the content of a response using a connection previously created by UpnpOpenHttpConnection. More... | |
| int | UpnpCloseHttpConnection (void *handle) |
| Closes the connection created with UpnpOpenHttpConnection and frees any memory associated with the connection. More... | |
| int | UpnpDownloadXmlDoc (const char *url, IXML_Document **xmlDoc) |
| Downloads an XML document specified in a URL. More... | |
Web Server API | |
| typedef void * | UpnpWebFileHandle |
| The type of handle returned by the web server for open requests. More... | |
| typedef int(* | VDCallback_GetInfo) (const char *filename, UpnpFileInfo *info, const void *cookie) |
| Get-info callback function prototype. More... | |
| typedef UpnpWebFileHandle(* | VDCallback_Open) (const char *filename, enum UpnpOpenFileMode Mode, const void *cookie) |
| Open callback function prototype. More... | |
| typedef int(* | VDCallback_Read) (UpnpWebFileHandle fileHnd, char *buf, size_t buflen, const void *cookie) |
| Read callback function prototype. More... | |
| typedef int(* | VDCallback_Write) (UpnpWebFileHandle fileHnd, char *buf, size_t buflen, const void *cookie) |
| Write callback function prototype. More... | |
| typedef int(* | VDCallback_Seek) (UpnpWebFileHandle fileHnd, off_t offset, int origin, const void *cookie) |
| Seek callback function prototype. More... | |
| typedef int(* | VDCallback_Close) (UpnpWebFileHandle fileHnd, const void *cookie) |
| Close callback function prototype. More... | |
| int | UpnpSetWebServerRootDir (const char *rootDir) |
| Sets the document root directory for the internal web server. More... | |
| int | UpnpVirtualDir_set_GetInfoCallback (VDCallback_GetInfo callback) |
| Sets the get_info callback function to be used to access a virtual directory. More... | |
| int | UpnpVirtualDir_set_OpenCallback (VDCallback_Open callback) |
| Sets the open callback function to be used to access a virtual directory. More... | |
| int | UpnpVirtualDir_set_ReadCallback (VDCallback_Read callback) |
| Sets the read callback function to be used to access a virtual directory. More... | |
| int | UpnpVirtualDir_set_WriteCallback (VDCallback_Write callback) |
| Sets the write callback function to be used to access a virtual directory. More... | |
| int | UpnpVirtualDir_set_SeekCallback (VDCallback_Seek callback) |
| Sets the seek callback function to be used to access a virtual directory. More... | |
| int | UpnpVirtualDir_set_CloseCallback (VDCallback_Close callback) |
| Sets the close callback function to be used to access a virtual directory. More... | |
| int | UpnpEnableWebserver (int enable) |
| Enables or disables the webserver. More... | |
| int | UpnpIsWebserverEnabled (void) |
Returns TRUE if the webserver is enabled, or FALSE if it is not. More... | |
| int | UpnpAddVirtualDir (const char *dirName, const void *cookie, const void **oldcookie) |
| Adds a virtual directory mapping. More... | |
| int | UpnpRemoveVirtualDir (const char *dirName) |
| Removes a virtual directory mapping made with UpnpAddVirtualDir. More... | |
| void | UpnpRemoveAllVirtualDirs (void) |
| Removes all virtual directory mappings. More... | |
1.8.17