2007-05-25 17:02:12 +02:00
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* Copyright (c) 2000-2003 Intel Corporation
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
*
|
|
|
|
* * Redistributions of source code must retain the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer.
|
|
|
|
* * Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
|
|
* and/or other materials provided with the distribution.
|
|
|
|
* * Neither name of Intel Corporation nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
|
|
|
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
|
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
|
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
|
|
|
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
|
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
2006-06-06 10:51:22 +02:00
|
|
|
|
|
|
|
#ifndef UPNP_H
|
|
|
|
#define UPNP_H
|
|
|
|
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \file */
|
|
|
|
|
|
|
|
|
|
|
|
/*! \defgroup TheApi The UPnP API */
|
|
|
|
/*@{*/
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2007-05-16 04:02:16 +02:00
|
|
|
|
2006-08-17 07:19:03 +02:00
|
|
|
#if defined MYLIB_LARGEFILE_SENSITIVE && _FILE_OFFSET_BITS+0 != 64
|
2007-05-16 04:02:16 +02:00
|
|
|
#if defined __GNUC__
|
|
|
|
#warning libupnp requires largefile mode - use AC_SYS_LARGEFILE
|
|
|
|
#else
|
|
|
|
#error libupnp requires largefile mode - use AC_SYS_LARGEFILE
|
|
|
|
#endif
|
2006-08-17 07:19:03 +02:00
|
|
|
#endif
|
|
|
|
|
2007-05-16 04:02:16 +02:00
|
|
|
|
2006-06-06 10:51:22 +02:00
|
|
|
#include <stdio.h>
|
2008-03-09 02:16:58 +01:00
|
|
|
#ifndef WIN32
|
|
|
|
#include <sys/param.h>
|
|
|
|
#endif
|
2007-06-09 15:40:22 +02:00
|
|
|
#if (defined(BSD) && BSD >= 199306)
|
2007-05-16 04:02:16 +02:00
|
|
|
#include <time.h>
|
2006-07-03 16:02:29 +02:00
|
|
|
#endif
|
2008-05-04 02:57:07 +02:00
|
|
|
|
|
|
|
|
2006-06-06 10:51:22 +02:00
|
|
|
#include "ixml.h"
|
|
|
|
#include "upnpconfig.h"
|
|
|
|
|
2007-05-16 04:02:16 +02:00
|
|
|
|
2006-06-13 14:34:29 +02:00
|
|
|
#ifdef WIN32
|
2007-05-16 04:02:16 +02:00
|
|
|
#ifndef UPNP_STATIC_LIB
|
|
|
|
#ifdef LIBUPNP_EXPORTS
|
2007-05-25 17:02:12 +02:00
|
|
|
/* set up declspec for dll export to make functions visible to library users */
|
2007-05-16 04:02:16 +02:00
|
|
|
#define EXPORT_SPEC __declspec(dllexport)
|
|
|
|
#else
|
|
|
|
#define EXPORT_SPEC __declspec(dllimport)
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#define EXPORT_SPEC
|
|
|
|
#endif
|
2007-05-23 15:20:55 +02:00
|
|
|
#ifdef UPNP_USE_MSVCPP
|
2007-05-25 17:02:12 +02:00
|
|
|
/* define some things the M$ VC++ doesn't know */
|
2007-05-23 15:20:55 +02:00
|
|
|
#define UPNP_INLINE
|
2007-05-16 04:02:16 +02:00
|
|
|
typedef __int64 int64_t;
|
|
|
|
#define PRId64 "I64d"
|
|
|
|
#define PRIzu "lu"
|
|
|
|
#endif
|
2007-05-23 15:20:55 +02:00
|
|
|
#ifdef UPNP_USE_BCBPP
|
2007-05-25 17:02:12 +02:00
|
|
|
/* define some things Borland Builder doesn't know */
|
2007-05-23 15:20:55 +02:00
|
|
|
#define UPNP_INLINE inline
|
2007-05-16 04:02:16 +02:00
|
|
|
typedef __int64 int64_t;
|
2007-05-23 15:20:55 +02:00
|
|
|
#warning The Borland C compiler is probably broken on PRId64, please someone provide a proper fix here
|
|
|
|
#define PRId64 "I64d"
|
2007-05-16 04:02:16 +02:00
|
|
|
#define PRIzu "zu"
|
|
|
|
#endif
|
2006-06-13 14:34:29 +02:00
|
|
|
#else
|
2007-05-16 04:02:16 +02:00
|
|
|
#define EXPORT_SPEC
|
2007-05-23 15:20:55 +02:00
|
|
|
#define UPNP_INLINE inline
|
2007-05-25 17:02:12 +02:00
|
|
|
/* Invented this macro so that we can live a little longer with MSVC lack of C99. */
|
2007-05-16 04:02:16 +02:00
|
|
|
#define PRIzu "zu"
|
2006-06-13 14:34:29 +02:00
|
|
|
#endif
|
|
|
|
|
2007-05-25 17:02:12 +02:00
|
|
|
/*
|
|
|
|
* Defining this macro here gives some interesting information about unused
|
|
|
|
* functions in the code. Of course, this should never go uncommented on a
|
|
|
|
* release.
|
|
|
|
*/
|
|
|
|
/*#define inline*/
|
2007-05-23 15:20:55 +02:00
|
|
|
|
2007-05-16 04:02:16 +02:00
|
|
|
|
2006-06-13 12:07:07 +02:00
|
|
|
#ifndef WIN32
|
2007-05-25 17:02:12 +02:00
|
|
|
#define UpnpCloseSocket close
|
2006-06-13 12:07:07 +02:00
|
|
|
#else
|
2007-05-25 17:02:12 +02:00
|
|
|
#define UpnpCloseSocket closesocket
|
2007-05-16 04:02:16 +02:00
|
|
|
#define fseeko fseek
|
2006-06-13 12:07:07 +02:00
|
|
|
#endif
|
|
|
|
#ifndef WIN32
|
2007-05-25 17:02:12 +02:00
|
|
|
#define SOCKET int
|
2008-05-02 19:04:22 +02:00
|
|
|
#define INVALID_SOCKET (SOCKET)(~0)
|
2006-06-13 12:07:07 +02:00
|
|
|
#endif
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2007-05-16 04:02:16 +02:00
|
|
|
|
2006-06-13 12:07:07 +02:00
|
|
|
#ifndef WIN32
|
2007-05-16 04:02:16 +02:00
|
|
|
#include <netinet/in.h>
|
2006-06-13 12:07:07 +02:00
|
|
|
#else
|
2008-05-02 19:04:22 +02:00
|
|
|
#include <Ws2tcpip.h>
|
|
|
|
#include <iphlpapi.h>
|
2007-05-16 04:02:16 +02:00
|
|
|
#include <time.h>
|
2006-06-13 12:07:07 +02:00
|
|
|
#endif
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2007-05-16 04:02:16 +02:00
|
|
|
|
2006-08-17 07:31:55 +02:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
2007-05-16 04:02:16 +02:00
|
|
|
|
2006-06-08 08:41:00 +02:00
|
|
|
#define NUM_HANDLE 200
|
2006-06-06 10:51:22 +02:00
|
|
|
#define LINE_SIZE 180
|
|
|
|
#define NAME_SIZE 256
|
|
|
|
#define MNFT_NAME_SIZE 64
|
|
|
|
#define MODL_NAME_SIZE 32
|
|
|
|
#define SERL_NUMR_SIZE 64
|
|
|
|
#define MODL_DESC_SIZE 64
|
2008-04-26 03:20:09 +02:00
|
|
|
#define UPNP_INFINITE -1
|
|
|
|
#define UPNP_USING_CHUNKED -3
|
|
|
|
#define UPNP_UNTIL_CLOSE -4
|
2006-06-06 10:51:22 +02:00
|
|
|
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \name 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.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
/*@{*/
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The operation completed successfully.
|
|
|
|
*
|
|
|
|
* For asynchronous functions, this only means that the packet generated by
|
|
|
|
* the operation was successfully transmitted on the network. The result of
|
|
|
|
* the entire operation comes as part of the callback for that operation.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_SUCCESS 0
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The handle passed to a function is not a recognized as a valid handle.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_INVALID_HANDLE -100
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief One or more of the parameters passed to the function is not valid.
|
|
|
|
*
|
|
|
|
* Refer to the documentation for each function for more information on the
|
|
|
|
* valid ranges of the parameters.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_INVALID_PARAM -101
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The SDK does not have any more space for additional handles.
|
|
|
|
*
|
|
|
|
* The SDK allocates space for only a few handles in order to conserve memory.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_OUTOF_HANDLE -102
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_OUTOF_CONTEXT -103
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief Not enough resources are currently available to complete the operation.
|
|
|
|
*
|
|
|
|
* Most operations require some free memory in order to complete their work.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_OUTOF_MEMORY -104
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The SDK has already been initialized.
|
|
|
|
*
|
|
|
|
* The SDK needs to be initialied only once per process. Any additional
|
|
|
|
* initialization attempts simply return this error with no other ill effects.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_INIT -105
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_BUFFER_TOO_SMALL -106
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/* \brief !The description document passed to \b UpnpRegisterRootDevice or
|
|
|
|
* \b UpnpRegisterRootDevice2 is invalid.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_INVALID_DESC -107
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief An URL passed into the function is invalid.
|
|
|
|
*
|
|
|
|
* The actual cause is function specific, but in general, the URL itself
|
|
|
|
* might be malformed (e.g. have invalid characters in it) or the host might
|
|
|
|
* be unreachable.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_INVALID_URL -108
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_INVALID_SID -109
|
|
|
|
#define UPNP_E_INVALID_DEVICE -110
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The device ID/service ID pair does not refer to a valid service.
|
|
|
|
*
|
|
|
|
* Returned only by \b UpnpNotify, \b UpnpNotifyExt, \b UpnpAcceptSubscription,
|
|
|
|
* and \b UpnpAcceptSubscriptionExt.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_INVALID_SERVICE -111
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The response received from the remote side of a connection is not correct
|
|
|
|
* for the protocol.
|
|
|
|
*
|
|
|
|
* This applies to the GENA, SOAP, and HTTP protocols.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_BAD_RESPONSE -113
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_BAD_REQUEST -114
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The SOAP action message is invalid.
|
|
|
|
*
|
|
|
|
* This can be because the DOM document passed to the function was malformed or
|
|
|
|
* the action message is not correct for the given action.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_INVALID_ACTION -115
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief \b UpnpInit has not been called, or \b UpnpFinish has already been called.
|
|
|
|
*
|
|
|
|
* None of the API functions operate until \b UpnpInit successfully completes.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_FINISH -116
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief \b UpnpInit cannot complete.
|
|
|
|
*
|
|
|
|
* The typical reason is failure to allocate sufficient resources.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_INIT_FAILED -117
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The URL passed into a function is too long.
|
|
|
|
*
|
|
|
|
* The SDK limits URLs to 180 characters in length.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_URL_TOO_BIG -118
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The HTTP message contains invalid message headers.
|
|
|
|
*
|
|
|
|
* The error always refers to the HTTP message header received from the remote
|
|
|
|
* host. The main areas where this occurs are in SOAP control messages (e.g.
|
|
|
|
* \b UpnpSendAction), GENA subscription message (e.g. \b UpnpSubscribe),
|
|
|
|
* GENA event notifications (e.g. \b UpnpNotify), and HTTP transfers (e.g.
|
|
|
|
* \b UpnpDownloadXmlDoc).
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_BAD_HTTPMSG -119
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief A client or a device is already registered.
|
|
|
|
*
|
|
|
|
* The SDK currently has a limit of one registered client and one registered
|
|
|
|
* device per process.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_ALREADY_REGISTERED -120
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The interface provided to \b UpnpInit2 is unknown or does not have a valid
|
|
|
|
* IPv4 or IPv6 address configured.
|
2008-05-02 19:04:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_INVALID_INTERFACE -121
|
2008-05-02 19:04:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief A network error occurred.
|
|
|
|
*
|
|
|
|
* It is the generic error code for network problems that are not covered under
|
|
|
|
* one of the more specific error codes. The typical meaning is the SDK failed
|
|
|
|
* to read the local IP address or had problems configuring one of the sockets.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_NETWORK_ERROR -200
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief An error happened while writing to a socket.
|
|
|
|
*
|
|
|
|
* This occurs in any function that makes network connections, such as discovery
|
|
|
|
* (e.g. \b UpnpSearchAsync or \b UpnpSendAdvertisement), control (e.g.
|
|
|
|
* \b UpnpSendAction), eventing (e.g. \b UpnpNotify), and HTTP functions (e.g.
|
|
|
|
* \b UpnpDownloadXmlDoc).
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_SOCKET_WRITE -201
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief An error happened while reading from a socket.
|
|
|
|
*
|
|
|
|
* This occurs in any function that makes network connections, such as discovery
|
|
|
|
* (e.g. \b UpnpSearchAsync or \b UpnpSendAdvertisement), control (e.g.
|
|
|
|
* \b UpnpSendAction), eventing (e.g. \b UpnpNotify), and HTTP functions (e.g.
|
|
|
|
* \b UpnpDownloadXmlDoc).
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_SOCKET_READ -202
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The SDK had a problem binding a socket to a network interface.
|
|
|
|
*
|
|
|
|
* This occurs in any function that makes network connections, such as discovery
|
|
|
|
* (e.g. \b UpnpSearchAsync or \b UpnpSendAdvertisement), control (e.g.
|
|
|
|
* \b UpnpSendAction), eventing (e.g. \b UpnpNotify), and HTTP functions (e.g.
|
|
|
|
* \b UpnpDownloadXmlDoc).
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_SOCKET_BIND -203
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The SDK had a problem connecting to a remote host.
|
|
|
|
*
|
|
|
|
* This occurs in any function that makes network connections, such as discovery
|
|
|
|
* (e.g. \b UpnpSearchAsync or \b UpnpSendAdvertisement), control (e.g.
|
|
|
|
* \b UpnpSendAction), eventing (e.g. \b UpnpNotify), and HTTP functions (e.g.
|
|
|
|
* \b UpnpDownloadXmlDoc).
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_SOCKET_CONNECT -204
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The SDK cannot create any more sockets.
|
|
|
|
*
|
|
|
|
* This occurs in any function that makes network connections, such as discovery
|
|
|
|
* (e.g. \b UpnpSearchAsync or \b UpnpSendAdvertisement), control (e.g.
|
|
|
|
* \b UpnpSendAction), eventing (e.g. \b UpnpNotify), and HTTP functions (e.g.
|
|
|
|
* \b UpnpDownloadXmlDoc).
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_OUTOF_SOCKET -205
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The SDK had a problem setting the socket to listen for incoming
|
|
|
|
* connections.
|
|
|
|
*
|
|
|
|
* This error only happens during initialization (i.e. \b UpnpInit).
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_LISTEN -206
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief Too much time elapsed before the required number of bytes were sent
|
|
|
|
* or received over a socket.
|
|
|
|
*
|
|
|
|
* This error can be returned by any function that performs network operations.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_TIMEDOUT -207
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief Generic socket error code for conditions not covered by other error
|
|
|
|
* codes.
|
|
|
|
*
|
|
|
|
* This error can be returned by any function that performs network operations.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_SOCKET_ERROR -208
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_FILE_WRITE_ERROR -209
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The operation was canceled.
|
|
|
|
*
|
|
|
|
* This error can be returned by any function that allows for external cancelation.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_CANCELED -210
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_EVENT_PROTOCOL -300
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief A subscription request was rejected from the remote side.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_SUBSCRIBE_UNACCEPTED -301
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief An unsubscribe request was rejected from the remote side.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_UNSUBSCRIBE_UNACCEPTED -302
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The remote host did not accept the notify sent from the local device.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_NOTIFY_UNACCEPTED -303
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief One or more of the parameters passed to a function is invalid.
|
|
|
|
*
|
|
|
|
* Refer to the individual function descriptions for the acceptable ranges for
|
|
|
|
* parameters.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_INVALID_ARGUMENT -501
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The filename passed to one of the device registration functions was
|
|
|
|
* not found or was not accessible.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_FILE_NOT_FOUND -502
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief An error happened while reading a file.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_FILE_READ_ERROR -503
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The file name of the description document passed to
|
|
|
|
* \b UpnpRegisterRootDevice2 does not end in ".xml".
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_EXT_NOT_XML -504
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_NO_WEB_SERVER -505
|
|
|
|
#define UPNP_E_OUTOF_BOUNDS -506
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The response to a SOAP request did not contain the required XML
|
|
|
|
* constructs.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_NOT_FOUND -507
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief Generic error code for internal conditions not covered by other
|
|
|
|
* error codes.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
#define UPNP_E_INTERNAL_ERROR -911
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2007-05-25 17:02:12 +02:00
|
|
|
/* SOAP-related error codes */
|
2008-05-04 21:56:15 +02:00
|
|
|
#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
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! @} */ /* ErrorCodes */
|
2006-06-06 10:51:22 +02:00
|
|
|
|
|
|
|
#ifndef OUT
|
|
|
|
#define OUT
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef IN
|
|
|
|
#define IN
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef INOUT
|
|
|
|
#define INOUT
|
|
|
|
#endif
|
|
|
|
|
2008-05-04 02:57:07 +02:00
|
|
|
|
2007-05-18 15:31:21 +02:00
|
|
|
#include "upnpdebug.h"
|
|
|
|
|
2008-04-26 03:20:09 +02:00
|
|
|
|
2008-05-04 02:57:07 +02:00
|
|
|
/*
|
|
|
|
* Opaque data structures. The following includes are data structures that
|
|
|
|
* must be externally visible. Since version 1.8.0, only an opaque typedef
|
|
|
|
* is visible from the outside world. Any operation on these data types
|
|
|
|
* must be done using the appropriate interface functions.
|
|
|
|
*
|
|
|
|
* This policy has the great advantage that it is now possible to change
|
|
|
|
* the internal implementation of these data structures without breaking
|
|
|
|
* the API.
|
|
|
|
*/
|
2008-04-26 03:20:09 +02:00
|
|
|
#include "ActionComplete.h"
|
|
|
|
#include "ActionRequest.h"
|
|
|
|
#include "Discovery.h"
|
2008-05-03 17:35:14 +02:00
|
|
|
#include "Event.h"
|
2008-04-26 03:20:09 +02:00
|
|
|
#include "EventSubscribe.h"
|
|
|
|
#include "FileInfo.h"
|
|
|
|
#include "StateVarComplete.h"
|
|
|
|
#include "StateVarRequest.h"
|
2008-05-03 23:19:08 +02:00
|
|
|
#include "SubscriptionRequest.h"
|
2008-04-26 03:20:09 +02:00
|
|
|
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \name Constants, and Types */
|
|
|
|
/*! @{ */
|
|
|
|
|
2008-04-26 03:20:09 +02:00
|
|
|
enum UpnpOpenFileMode
|
|
|
|
{
|
|
|
|
UPNP_READ,
|
|
|
|
UPNP_WRITE
|
|
|
|
};
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Returned when a control point application registers with \b
|
|
|
|
* UpnpRegisterClient. Client handles can only be used with
|
|
|
|
* functions that operate with a client handle.
|
|
|
|
*/
|
2006-06-06 10:51:22 +02:00
|
|
|
typedef int UpnpClient_Handle;
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Returned when a device application registers with \b UpnpRegisterRootDevice
|
|
|
|
* or \b UpnpRegisterRootDevice2. Device handles can only be used with
|
|
|
|
* functions that operate with a device handle.
|
|
|
|
*/
|
2006-06-06 10:51:22 +02:00
|
|
|
typedef int UpnpDevice_Handle;
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief The reason code for an event callback.
|
|
|
|
*
|
|
|
|
* The \b Event parameter will be different depending on the reason for the
|
|
|
|
* callback. The descriptions for each event type describe the contents of the
|
|
|
|
* \b Event parameter.
|
|
|
|
*/
|
2006-06-06 10:51:22 +02:00
|
|
|
enum Upnp_EventType_e {
|
2008-05-03 23:49:43 +02:00
|
|
|
/*
|
|
|
|
* Control callbacks
|
|
|
|
*/
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Received by a device when a control point issues a control
|
|
|
|
* request. The \b Event parameter contains a pointer to a \b
|
|
|
|
* UpnpActionRequest structure containing the action. The application
|
|
|
|
* stores the results of the action in this structure. */
|
2008-05-03 23:49:43 +02:00
|
|
|
UPNP_CONTROL_ACTION_REQUEST,
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! A \b UpnpSendActionAsync call completed. The \b Event
|
|
|
|
* parameter contains a pointer to a \b UpnpActionComplete structure
|
|
|
|
* with the results of the action. */
|
2008-05-03 23:49:43 +02:00
|
|
|
UPNP_CONTROL_ACTION_COMPLETE,
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Received by a device when a query for a single service variable
|
|
|
|
* arrives. The \b Event parameter contains a pointer to a \b
|
|
|
|
* UpnpStateVarRequest structure containing the name of the variable
|
|
|
|
* and value. */
|
2008-05-03 23:49:43 +02:00
|
|
|
UPNP_CONTROL_GET_VAR_REQUEST,
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! A \b UpnpGetServiceVarStatus call completed. The \b Event
|
|
|
|
* parameter contains a pointer to a \b UpnpStateVarComplete structure
|
|
|
|
* containing the value for the variable. */
|
2008-05-03 23:49:43 +02:00
|
|
|
UPNP_CONTROL_GET_VAR_COMPLETE,
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Discovery callbacks
|
|
|
|
*/
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Received by a control point when a new device or service is available.
|
|
|
|
* The \b Event parameter contains a pointer to a \b
|
|
|
|
* UpnpDiscovery structure with the information about the device
|
|
|
|
* or service. */
|
2008-05-03 23:49:43 +02:00
|
|
|
UPNP_DISCOVERY_ADVERTISEMENT_ALIVE,
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Received by a control point when a device or service shuts down. The \b
|
|
|
|
* Event parameter contains a pointer to a \b UpnpDiscovery
|
|
|
|
* structure containing the information about the device or
|
|
|
|
* service. */
|
2008-05-03 23:49:43 +02:00
|
|
|
UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE,
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Received by a control point when a matching device or service responds.
|
|
|
|
* The \b Event parameter contains a pointer to a \b
|
|
|
|
* UpnpDiscovery structure containing the information about
|
|
|
|
* the reply to the search request. */
|
2008-05-03 23:49:43 +02:00
|
|
|
UPNP_DISCOVERY_SEARCH_RESULT,
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Received by a control point when the search timeout expires. The
|
|
|
|
* SDK generates no more callbacks for this search after this
|
|
|
|
* event. The \b Event parameter is \c NULL. */
|
2008-05-03 23:49:43 +02:00
|
|
|
UPNP_DISCOVERY_SEARCH_TIMEOUT,
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Eventing callbacks
|
|
|
|
*/
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Received by a device when a subscription arrives.
|
|
|
|
* The \b Event parameter contains a pointer to a \b
|
|
|
|
* UpnpSubscriptionRequest structure. At this point, the
|
|
|
|
* subscription has already been accepted. \b UpnpAcceptSubscription
|
|
|
|
* needs to be called to confirm the subscription and transmit the
|
|
|
|
* initial state table. This can be done during this callback. The SDK
|
|
|
|
* generates no events for a subscription unless the device
|
|
|
|
* application calls \b UpnpAcceptSubscription.
|
2008-05-03 23:49:43 +02:00
|
|
|
*/
|
|
|
|
UPNP_EVENT_SUBSCRIPTION_REQUEST,
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Received by a control point when an event arrives. The \b
|
|
|
|
* Event parameter contains a \b UpnpEvent structure
|
|
|
|
* with the information about the event. */
|
2008-05-03 23:49:43 +02:00
|
|
|
UPNP_EVENT_RECEIVED,
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! A \b UpnpRenewSubscriptionAsync call completed. The status of
|
|
|
|
* the renewal is in the \b Event parameter as a \b
|
|
|
|
* Upnp_Event_Subscription structure. */
|
2008-05-03 23:49:43 +02:00
|
|
|
UPNP_EVENT_RENEWAL_COMPLETE,
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! A \b UpnpSubscribeAsync call completed. The status of the
|
|
|
|
* subscription is in the \b Event parameter as a \b
|
|
|
|
* Upnp_Event_Subscription structure. */
|
2008-05-03 23:49:43 +02:00
|
|
|
UPNP_EVENT_SUBSCRIBE_COMPLETE,
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! A \b UpnpUnSubscribeAsync call completed. The status of the
|
|
|
|
* subscription is in the \b Event parameter as a \b
|
|
|
|
* UpnpEventSubscribe structure. */
|
2008-05-03 23:49:43 +02:00
|
|
|
UPNP_EVENT_UNSUBSCRIBE_COMPLETE,
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The auto-renewal of a client subscription failed.
|
|
|
|
* The \b Event parameter is a \b UpnpEventSubscribe structure
|
|
|
|
* with the error code set appropriately. The subscription is no longer
|
|
|
|
* valid. */
|
2008-05-03 23:49:43 +02:00
|
|
|
UPNP_EVENT_AUTORENEWAL_FAILED,
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! A client subscription has expired. This will only occur
|
|
|
|
* if auto-renewal of subscriptions is disabled.
|
|
|
|
* The \b Event parameter is a \b UpnpEventSubscribe
|
|
|
|
* structure. The subscription is no longer valid. */
|
2008-05-03 23:49:43 +02:00
|
|
|
UPNP_EVENT_SUBSCRIPTION_EXPIRED
|
2006-06-06 10:51:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum Upnp_EventType_e Upnp_EventType;
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief Holds the subscription identifier for a subscription between a
|
|
|
|
* client and a device.
|
|
|
|
*
|
|
|
|
* The SID is a string representation of a globally unique id (GUID) and should
|
|
|
|
* not be modified.
|
|
|
|
*/
|
2006-06-06 10:51:22 +02:00
|
|
|
typedef char Upnp_SID[44];
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief Represents the different types of searches that can be performed
|
|
|
|
* using the SDK for UPnP Devices API.
|
|
|
|
*
|
|
|
|
* By specifying these different values to \b UpnpSearchAsync, the control
|
|
|
|
* point application can control the scope of the search from all devices
|
|
|
|
* to specific devices or services.
|
|
|
|
*/
|
2006-06-06 10:51:22 +02:00
|
|
|
enum Upnp_SType_e {
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Search for all devices and services on the network. */
|
2008-05-03 23:49:43 +02:00
|
|
|
UPNP_S_ALL,
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Search for all root devices on the network. */
|
2008-05-03 23:49:43 +02:00
|
|
|
UPNP_S_ROOT,
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Search for a particular device type or a particular device instance. */
|
2008-05-03 23:49:43 +02:00
|
|
|
UPNP_S_DEVICE,
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Search for a particular service type, possibly on a particular
|
2008-05-03 23:49:43 +02:00
|
|
|
* device type or device instance. */
|
|
|
|
UPNP_S_SERVICE
|
2006-06-06 10:51:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum Upnp_SType_e Upnp_SType;
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief Specifies the type of description in \b UpnpRegisterRootDevice2.
|
|
|
|
*
|
|
|
|
* These values control how \b UpnpRegisterRootDevice2 interprets the
|
|
|
|
* \b description parameter.
|
|
|
|
*/
|
2006-06-06 10:51:22 +02:00
|
|
|
enum Upnp_DescType_e {
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The description is the URL to the description document. */
|
2006-06-06 10:51:22 +02:00
|
|
|
UPNPREG_URL_DESC,
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The description is a file name on the local file system
|
2006-06-06 10:51:22 +02:00
|
|
|
containing the description of the device. */
|
|
|
|
UPNPREG_FILENAME_DESC,
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The description is a pointer to a character array containing
|
2006-06-06 10:51:22 +02:00
|
|
|
the XML description document. */
|
|
|
|
UPNPREG_BUF_DESC
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum Upnp_DescType_e Upnp_DescType;
|
|
|
|
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! All callback functions share the same prototype, documented below.
|
2006-06-06 10:51:22 +02:00
|
|
|
* Note that any memory passed to the callback function
|
|
|
|
* is valid only during the callback and should be copied if it
|
|
|
|
* needs to persist. This callback function needs to be thread
|
|
|
|
* safe. The context of the callback is always on a valid thread
|
|
|
|
* context and standard synchronization methods can be used. Note,
|
|
|
|
* however, because of this the callback cannot call SDK functions
|
|
|
|
* unless explicitly noted.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \verbatim
|
|
|
|
int CallbackFxn(Upnp_EventType EventType, void *Event, void *Cookie);
|
|
|
|
\endverbatim
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* where \b EventType is the event that triggered the callback,
|
|
|
|
* \b Event is a structure that denotes event-specific information for that
|
|
|
|
* event, and \b Cookie is the user data passed when the callback was
|
2006-06-06 10:51:22 +02:00
|
|
|
* registered.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* See \b Upnp_EventType for more information on the callback values and
|
|
|
|
* the associated \b Event parameter.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
|
|
|
* The return value of the callback is currently ignored. It may be used
|
|
|
|
* in the future to communicate results back to the SDK.
|
|
|
|
*/
|
2008-04-26 03:20:09 +02:00
|
|
|
typedef int (*Upnp_FunPtr)(IN Upnp_EventType EventType, IN void *Event, IN void *Cookie);
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2007-05-25 17:02:12 +02:00
|
|
|
/*! @} */ /* Constants, Structures, and Types */
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
|
2006-06-06 10:51:22 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
2007-05-25 17:02:12 +02:00
|
|
|
#endif /* __cplusplus */
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
|
|
|
|
/*! \name Initialization and Registration */
|
2007-05-25 17:02:12 +02:00
|
|
|
/*! @{ */
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-02 19:04:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief Initializes the Linux SDK for UPnP Devices.
|
|
|
|
*
|
|
|
|
* \deprecated Kept for backwards compatibility. Use UpnpInit2 for new
|
|
|
|
* implementations.
|
|
|
|
*
|
|
|
|
* This function must be called before any other API function can be called.
|
|
|
|
* It should be called only once. Subsequent calls to this API return a
|
|
|
|
* \c UPNP_E_INIT error code.
|
|
|
|
*
|
|
|
|
* Optionally, the application can specify a host IP address (in the
|
|
|
|
* case of a multi-homed configuration) and a port number to use for
|
|
|
|
* all UPnP operations. Since a port number can be used only by one
|
|
|
|
* process, multiple processes using the SDK must specify
|
|
|
|
* different port numbers.
|
|
|
|
*
|
|
|
|
* If unspecified, the SDK will use the first adapter's IP address
|
|
|
|
* and an arbitrary port.
|
|
|
|
*
|
|
|
|
* This call is synchronous.
|
|
|
|
*
|
|
|
|
* \return An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist
|
|
|
|
* to initialize the SDK.
|
|
|
|
* \li \c UPNP_E_INIT: The SDK is already initialized.
|
|
|
|
* \li \c UPNP_E_INIT_FAILED: The SDK initialization
|
|
|
|
* failed for an unknown reason.
|
|
|
|
* \li \c UPNP_E_SOCKET_BIND: An error occurred binding a socket.
|
|
|
|
* \li \c UPNP_E_LISTEN: An error occurred listening to a socket.
|
|
|
|
* \li \c UPNP_E_OUTOF_SOCKET: An error ocurred creating a socket.
|
|
|
|
* \li \c UPNP_E_INTERNAL_ERROR: An internal error ocurred.
|
|
|
|
*/
|
|
|
|
EXPORT_SPEC int UpnpInit(
|
|
|
|
/*! The host local IP address to use, in string format, for example
|
|
|
|
* "192.168.0.1", or \c NULL to use the first adapter's IP address. */
|
|
|
|
IN const char *HostIP,
|
|
|
|
/*! Local Port to listen for incoming connections
|
|
|
|
* \c NULL will pick an arbitrary free port. */
|
|
|
|
IN unsigned short DestPort);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief Initializes the Linux SDK for UPnP Devices.
|
|
|
|
*
|
|
|
|
* This function must be called before any other API function can be called.
|
|
|
|
* It should be called only once. Subsequent calls to this API return a
|
|
|
|
* \c UPNP_E_INIT error code.
|
|
|
|
*
|
|
|
|
* Optionally, the application can specify an interface name (in the
|
|
|
|
* case of a multi-homed configuration) and a port number to use for
|
|
|
|
* all UPnP operations. Since a port number can be used only by one
|
|
|
|
* process, multiple processes using the SDK must specify
|
|
|
|
* different port numbers.
|
|
|
|
*
|
|
|
|
* If unspecified, the SDK will use the first suitable interface and an
|
|
|
|
* arbitrary port.
|
|
|
|
*
|
|
|
|
* This call is synchronous.
|
|
|
|
*
|
|
|
|
* \return An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist
|
|
|
|
* to initialize the SDK.
|
|
|
|
* \li \c UPNP_E_INIT: The SDK is already initialized.
|
|
|
|
* \li \c UPNP_E_INIT_FAILED: The SDK initialization
|
|
|
|
* failed for an unknown reason.
|
|
|
|
* \li \c UPNP_E_SOCKET_BIND: An error occurred binding a socket.
|
|
|
|
* \li \c UPNP_E_LISTEN: An error occurred listening to a socket.
|
|
|
|
* \li \c UPNP_E_OUTOF_SOCKET: An error ocurred creating a socket.
|
|
|
|
* \li \c UPNP_E_INTERNAL_ERROR: An internal error ocurred.
|
|
|
|
* \li \c UPNP_E_INVALID_INTERFACE: IfName is invalid or does not
|
|
|
|
* have a valid IPv4 or IPv6 addresss configured.
|
|
|
|
*/
|
2008-05-02 19:04:22 +02:00
|
|
|
EXPORT_SPEC int UpnpInit2(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The interface name to use by the UPnP SDK operations.
|
|
|
|
* Examples: "eth0", "xl0", "Local Area Connection", \c NULL to
|
|
|
|
* use the first suitable interface. */
|
|
|
|
IN const char *IfName,
|
|
|
|
/*! Local Port to listen for incoming connections.
|
|
|
|
* \c NULL will pick an arbitrary free port. */
|
|
|
|
IN unsigned short DestPort);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief Terminates the Linux SDK for UPnP Devices.
|
|
|
|
*
|
|
|
|
* \li Checks for pending jobs and threads
|
|
|
|
* \li Unregisters either the client or device
|
|
|
|
* \li Shuts down the Timer Thread
|
|
|
|
* \li Stops the Mini Server
|
|
|
|
* \li Uninitializes the Thread Pool
|
|
|
|
* \li For Win32 cleans up Winsock Interface
|
|
|
|
* \li Cleans up mutex objects
|
|
|
|
*
|
|
|
|
* This function must be the last API function called. It should be called only
|
|
|
|
* once. Subsequent calls to this API return a \c UPNP_E_FINISH error code.
|
|
|
|
*
|
|
|
|
* \return An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_FINISH: The SDK is already terminated or
|
2006-06-06 10:51:22 +02:00
|
|
|
* it is not initialized.
|
2008-05-04 21:56:15 +02:00
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpFinish();
|
2006-06-06 10:51:22 +02:00
|
|
|
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief Returns the internal server IPv4 UPnP listening port.
|
|
|
|
*
|
|
|
|
* If '0' is used as the port number in \b UpnpInit, then this function can be
|
|
|
|
* used to retrieve the actual port allocated to the SDK.
|
2008-05-02 19:04:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return
|
|
|
|
* \li On success: The port on which an internal server is listening for IPv4 UPnP
|
|
|
|
* related requests.
|
|
|
|
* \li On error: 0 is returned if \b UpnpInit has not succeeded.
|
2008-05-02 19:04:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
EXPORT_SPEC unsigned short UpnpGetServerPort();
|
2008-05-02 19:04:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
|
|
|
|
/*! \brief Returns the internal server IPv6 UPnP listening port.
|
|
|
|
*
|
|
|
|
* If '0' is used as the port number in \b UpnpInit, then this function can be
|
|
|
|
* used to retrieve the actual port allocated to the SDK.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return
|
|
|
|
* \li On success: The port on which an internal server is listening for IPv6 UPnP
|
|
|
|
* related requests.
|
|
|
|
* \li On error: 0 is returned if \b UpnpInit has not succeeded.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
EXPORT_SPEC unsigned short UpnpGetServerPort6();
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief Returns the local IPv4 listening ip address.
|
2008-05-02 19:04:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* If \c NULL is used as the IPv4 address in \b UpnpInit, then this function can
|
|
|
|
* be used to retrieve the actual interface address on which device is running.
|
|
|
|
*
|
|
|
|
* \return
|
|
|
|
* \li On success: The IPv4 address on which an internal server is
|
|
|
|
* listening for UPnP related requests.
|
|
|
|
* \li On error: \c NULL is returned if \b UpnpInit has not succeeded.
|
2008-05-02 19:04:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
EXPORT_SPEC char *UpnpGetServerIpAddress();
|
|
|
|
|
2008-05-02 19:04:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief Returns the local IPv6 listening ip address.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* If \c NULL is used as the IPv6 address in \b UpnpInit, then this function can
|
|
|
|
* be used to retrieve the actual interface address on which device is running.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return
|
|
|
|
* \li On success: The IPv6 address on which an internal server is
|
|
|
|
* listening for UPnP related requests.
|
|
|
|
* \li On error: \c NULL is returned if \b UpnpInit has not succeeded.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 21:56:15 +02:00
|
|
|
EXPORT_SPEC char *UpnpGetServerIp6Address();
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpRegisterRootDevice registers a device application with
|
2006-06-06 10:51:22 +02:00
|
|
|
* the SDK. A device application cannot make any other API
|
|
|
|
* calls until it registers using this function. Device applications
|
2008-05-04 21:56:15 +02:00
|
|
|
* can also register as control points (see \b UpnpRegisterClient
|
2006-06-06 10:51:22 +02:00
|
|
|
* to get a control point handle to perform control point
|
|
|
|
* functionality).
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \b UpnpRegisterRootDevice is synchronous and does not generate
|
2006-06-06 10:51:22 +02:00
|
|
|
* any callbacks. Callbacks can occur as soon as this function returns.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_FINISH: The SDK is already terminated or is not
|
|
|
|
* initialized.
|
|
|
|
* \li \c UPNP_E_INVALID_DESC: The description document was not
|
|
|
|
* a valid device description.
|
|
|
|
* \li \c UPNP_E_INVALID_URL: The URL for the description document
|
2006-06-06 10:51:22 +02:00
|
|
|
* is not valid.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b Callback or \b Hnd
|
|
|
|
* is not a valid pointer or \b DescURL is \c NULL.
|
|
|
|
* \li \c UPNP_E_NETWORK_ERROR: A network error occurred.
|
|
|
|
* \li \c UPNP_E_SOCKET_WRITE: An error or timeout occurred writing
|
2006-06-06 10:51:22 +02:00
|
|
|
* to a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_READ: An error or timeout occurred reading
|
2006-06-06 10:51:22 +02:00
|
|
|
* from a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_BIND: An error occurred binding a socket.
|
|
|
|
* \li \c UPNP_E_SOCKET_CONNECT: An error occurred connecting the
|
2006-06-06 10:51:22 +02:00
|
|
|
* socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_SOCKET: Too many sockets are currently
|
2006-06-06 10:51:22 +02:00
|
|
|
* allocated.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: There are insufficient resources to
|
2006-06-06 10:51:22 +02:00
|
|
|
* register this root device.
|
2008-05-04 21:56:15 +02:00
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpRegisterRootDevice(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Pointer to a string containing the description URL for this root device
|
|
|
|
* instance. */
|
|
|
|
IN const char *DescUrl,
|
|
|
|
/*! Pointer to the callback function for receiving asynchronous events. */
|
|
|
|
IN Upnp_FunPtr Callback,
|
|
|
|
/*! Pointer to user data returned with the callback function when invoked. */
|
|
|
|
IN const void *Cookie,
|
|
|
|
/*! Pointer to a variable to store the new device handle. */
|
|
|
|
OUT UpnpDevice_Handle *Hnd);
|
|
|
|
|
|
|
|
/*! \b UpnpRegisterRootDevice2 is similar to \b UpnpRegisterRootDevice,
|
2006-06-06 10:51:22 +02:00
|
|
|
* except that it also allows the description document to be specified as a
|
|
|
|
* file or a memory buffer. The description can also be configured to have the
|
|
|
|
* correct IP and port address.
|
|
|
|
*
|
|
|
|
* NOTE: For the configuration to be functional, the internal web server
|
|
|
|
* MUST be present. In addition, the web server MUST be activated
|
2008-05-04 21:56:15 +02:00
|
|
|
* (using \b UpnpSetWebServerRootDir) before calling this function.
|
2006-06-06 10:51:22 +02:00
|
|
|
* The only condition where the web server can be absent is if the
|
|
|
|
* description document is specified as a URL and no configuration is
|
2008-05-04 21:56:15 +02:00
|
|
|
* required (i.e. <tt>config_baseURL = 0</tt>.)
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \b UpnpRegisterRootDevice2 is synchronous and does not generate
|
2006-06-06 10:51:22 +02:00
|
|
|
* any callbacks. Callbacks can occur as soon as this function returns.
|
|
|
|
*
|
|
|
|
* Examples of using different types of description documents:
|
2008-05-04 21:56:15 +02:00
|
|
|
* \verbatim
|
2006-06-06 10:51:22 +02:00
|
|
|
1) Description specified as a URL:
|
|
|
|
descriptionType == UPNPREG_URL_DESC
|
|
|
|
description is the URL
|
|
|
|
bufferLen = 0 (ignored)
|
|
|
|
2) Description specified as a file:
|
|
|
|
descriptionType == UPNPREG_FILENAME_DESC
|
|
|
|
description is a filename
|
|
|
|
bufferLen = 0 (ignored)
|
|
|
|
3) Description specified as a memory buffer:
|
|
|
|
descriptionType == UPNPREG_BUF_DESC
|
|
|
|
description is pointer to a memory buffer
|
|
|
|
bufferLen == length of memory buffer
|
2008-05-04 21:56:15 +02:00
|
|
|
\endverbatim
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_FINISH: The SDK is already terminated or
|
2006-06-06 10:51:22 +02:00
|
|
|
* is not initialized.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_DESC: The description document is not
|
2006-06-06 10:51:22 +02:00
|
|
|
* a valid device description.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b Callback or \b Hnd
|
|
|
|
* is not a valid pointer or \b DescURL is \c NULL.
|
|
|
|
* \li \c UPNP_E_NETWORK_ERROR: A network error occurred.
|
|
|
|
* \li \c UPNP_E_SOCKET_WRITE: An error or timeout occurred writing
|
2006-06-06 10:51:22 +02:00
|
|
|
* to a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_READ: An error or timeout occurred reading
|
2006-06-06 10:51:22 +02:00
|
|
|
* from a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_BIND: An error occurred binding a socket.
|
|
|
|
* \li \c UPNP_E_SOCKET_CONNECT: An error occurred connecting the
|
2006-06-06 10:51:22 +02:00
|
|
|
* socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_SOCKET: Too many sockets are currently
|
2006-06-06 10:51:22 +02:00
|
|
|
* allocated.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: There are insufficient resources to
|
2006-06-06 10:51:22 +02:00
|
|
|
* register this root device.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_URL_TOO_BIG: Length of the URL is bigger than the
|
2006-06-06 10:51:22 +02:00
|
|
|
* internal buffer.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_FILE_NOT_FOUND: The description file could not
|
2006-06-06 10:51:22 +02:00
|
|
|
* be found.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_FILE_READ_ERROR: An error occurred reading the
|
2006-06-06 10:51:22 +02:00
|
|
|
* description file.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_URL: The URL to the description document
|
2006-06-06 10:51:22 +02:00
|
|
|
* is invalid.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_EXT_NOT_XML: The URL to the description document
|
|
|
|
* or file should have a <tt>.xml</tt> extension.
|
|
|
|
* \li \c UPNP_E_NO_WEB_SERVER: The internal web server has been
|
2006-06-06 10:51:22 +02:00
|
|
|
* compiled out; the SDK cannot configure itself from the
|
|
|
|
* description document.
|
2008-05-04 21:56:15 +02:00
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpRegisterRootDevice2(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The type of the description document. */
|
|
|
|
IN Upnp_DescType descriptionType,
|
|
|
|
/*! Treated as a URL, file name or memory buffer depending on
|
|
|
|
* description type. */
|
|
|
|
IN const char* description,
|
|
|
|
/*! The length of memory buffer if passing a description in a buffer,
|
|
|
|
* otherwise it is ignored. */
|
|
|
|
IN size_t bufferLen,
|
|
|
|
/*! If nonzero, \c URLBase of description document is configured and
|
|
|
|
* the description is served using the internal web server. */
|
|
|
|
IN int config_baseURL,
|
|
|
|
/*! Pointer to the callback function for receiving asynchronous events. */
|
|
|
|
IN Upnp_FunPtr Fun,
|
|
|
|
/*! Pointer to user data returned with the callback function when
|
|
|
|
* invoked. */
|
|
|
|
IN const void* Cookie,
|
|
|
|
/*! Pointer to a variable to store the new device handle. */
|
|
|
|
OUT UpnpDevice_Handle* Hnd);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpRegisterRootDevice3 registers a device application for a
|
2008-05-02 19:04:22 +02:00
|
|
|
* specific address family with the SDK. A device application cannot
|
|
|
|
* make any other API calls until it registers using this function.
|
|
|
|
* Device applications can also register as control points (see
|
2008-05-04 21:56:15 +02:00
|
|
|
* \b UpnpRegisterClient to get a control point handle to perform
|
2008-05-02 19:04:22 +02:00
|
|
|
* control point functionality).
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \b UpnpRegisterRootDevice is synchronous and does not generate
|
2008-05-02 19:04:22 +02:00
|
|
|
* any callbacks. Callbacks can occur as soon as this function returns.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_FINISH: The SDK is already terminated or
|
2008-05-02 19:04:22 +02:00
|
|
|
* is not initialized.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_DESC: The description document was not
|
2008-05-02 19:04:22 +02:00
|
|
|
* a valid device description.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_URL: The URL for the description document
|
2008-05-02 19:04:22 +02:00
|
|
|
* is not valid.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b Callback or \b Hnd
|
|
|
|
* is not a valid pointer or \b DescURL is \c NULL.
|
|
|
|
* \li \c UPNP_E_NETWORK_ERROR: A network error occurred.
|
|
|
|
* \li \c UPNP_E_SOCKET_WRITE: An error or timeout occurred writing
|
2008-05-02 19:04:22 +02:00
|
|
|
* to a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_READ: An error or timeout occurred reading
|
2008-05-02 19:04:22 +02:00
|
|
|
* from a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_BIND: An error occurred binding a socket.
|
|
|
|
* \li \c UPNP_E_SOCKET_CONNECT: An error occurred connecting the
|
2008-05-02 19:04:22 +02:00
|
|
|
* socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_SOCKET: Too many sockets are currently
|
2008-05-02 19:04:22 +02:00
|
|
|
* allocated.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: There are insufficient resources to
|
2008-05-02 19:04:22 +02:00
|
|
|
* register this root device.
|
2008-05-04 21:56:15 +02:00
|
|
|
*/
|
2008-05-02 19:04:22 +02:00
|
|
|
EXPORT_SPEC int UpnpRegisterRootDevice3(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Pointer to a string containing the description URL for this root
|
|
|
|
* device instance. */
|
|
|
|
IN const char *DescUrl,
|
|
|
|
/*! Pointer to the callback function for receiving asynchronous events. */
|
|
|
|
IN Upnp_FunPtr Callback,
|
|
|
|
/*! Pointer to user data returned with the callback function when
|
|
|
|
* invoked. */
|
|
|
|
IN const void *Cookie,
|
|
|
|
/*! Pointer to a variable to store the new device handle. */
|
|
|
|
OUT UpnpDevice_Handle *Hnd,
|
|
|
|
/*! Address family of this device. Can be AF_INET for an IPv4 device, or
|
|
|
|
* AF_INET6 for an IPv6 device. Defaults to AF_INET. */
|
|
|
|
IN const int AddressFamily);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief Registers a control point application with the UPnP Library.
|
|
|
|
*
|
|
|
|
* A control point application cannot make any other API calls until it
|
|
|
|
* registers using this function.
|
|
|
|
*
|
|
|
|
* \b UpnpRegisterClient is a synchronous call and generates no callbacks.
|
|
|
|
* Callbacks can occur as soon as this function returns.
|
|
|
|
*
|
|
|
|
* \return An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_FINISH: The SDK is already terminated or
|
|
|
|
* is not initialized.
|
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b Callback or \b Hnd
|
|
|
|
* is not a valid pointer.
|
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
|
|
|
* register this control point.
|
|
|
|
*/
|
|
|
|
EXPORT_SPEC int UpnpRegisterClient(
|
|
|
|
/*! Pointer to a function for receiving asynchronous events. */
|
|
|
|
IN Upnp_FunPtr Callback,
|
|
|
|
/*! Pointer to user data returned with the callback function when invoked. */
|
|
|
|
IN const void *Cookie,
|
|
|
|
/*! Pointer to a variable to store the new control point handle. */
|
|
|
|
OUT UpnpClient_Handle *Hnd);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief Unregisters a control point application, unsubscribing all active
|
|
|
|
* subscriptions.
|
|
|
|
*
|
|
|
|
* This function unregisters a client registered with UpnpRegisterclient or
|
|
|
|
* UpnpRegisterclient2. After this call, the \b UpnpClient_Handle is no longer
|
|
|
|
* valid. The UPnP Library generates no more callbacks after this function
|
|
|
|
* returns.
|
|
|
|
*
|
|
|
|
* \b UpnpUnRegisterClient is a synchronous call and generates no
|
|
|
|
* callbacks.
|
|
|
|
*
|
|
|
|
* \return An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid control point handle.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpUnRegisterClient(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the control point instance to unregister. */
|
|
|
|
IN UpnpClient_Handle Hnd);
|
|
|
|
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief Unregisters a root device registered with \b UpnpRegisterRootDevice or
|
|
|
|
* \b UpnpRegisterRootDevice2. After this call, the
|
|
|
|
* \b UpnpDevice_Handle is no longer valid. For all advertisements that
|
2006-06-06 10:51:22 +02:00
|
|
|
* have not yet expired, the SDK sends a device unavailable message
|
|
|
|
* automatically.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \b UpnpUnRegisterRootDevice is a synchronous call and generates no
|
2006-06-06 10:51:22 +02:00
|
|
|
* callbacks. Once this call returns, the SDK will no longer
|
|
|
|
* generate callbacks to the application.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid device handle.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpUnRegisterRootDevice(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the root device instance to unregister. */
|
|
|
|
IN UpnpDevice_Handle);
|
2006-06-06 10:51:22 +02:00
|
|
|
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \deprecated Use \b UpnpSetMaxContentLength instead.
|
2006-06-06 10:51:22 +02:00
|
|
|
* Warning: the Handle argument provided here is not used, so the effect
|
|
|
|
* of this function is global to the SDK (= same as
|
2008-05-04 21:56:15 +02:00
|
|
|
* \b UpnpSetMaxContentLength ).
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpSetContentLength(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the device instance for which the coincoming content
|
|
|
|
* length needs to be set. */
|
|
|
|
IN UpnpClient_Handle Hnd,
|
|
|
|
/*! Permissible content length */
|
|
|
|
IN int contentLength);
|
2006-06-06 10:51:22 +02:00
|
|
|
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Sets the maximum content-length that the SDK will process on an incoming
|
2006-06-06 10:51:22 +02:00
|
|
|
* SOAP requests or responses. This API allows devices that have memory
|
|
|
|
* constraints to exhibit consistent behaviour if the size of the
|
|
|
|
* incoming SOAP message exceeds the memory that device can allocate.
|
2008-05-04 21:56:15 +02:00
|
|
|
* The default maximum content-length is \c DEFAULT_SOAP_CONTENT_LENGTH
|
2006-06-06 10:51:22 +02:00
|
|
|
* = 16K bytes.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpSetMaxContentLength(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The maximum permissible content length for incoming SOAP actions,
|
|
|
|
* in bytes. */
|
|
|
|
IN size_t contentLength);
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2007-05-25 17:02:12 +02:00
|
|
|
/*! @} */ /* Initialization and Registration */
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2007-05-25 17:02:12 +02:00
|
|
|
/******************************************************************************
|
|
|
|
******************************************************************************
|
|
|
|
* *
|
|
|
|
* D I S C O V E R Y *
|
|
|
|
* *
|
|
|
|
******************************************************************************
|
|
|
|
******************************************************************************/
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \name Discovery */
|
2007-05-25 17:02:12 +02:00
|
|
|
/*! @{ */
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \b UpnpSearchAsync searches for devices matching the given
|
2006-06-06 10:51:22 +02:00
|
|
|
* search target. The function returns immediately and the SDK
|
|
|
|
* calls the default callback function, registered during the
|
2008-05-04 21:56:15 +02:00
|
|
|
* \b UpnpRegisterClient call, for each matching root device,
|
2006-06-06 10:51:22 +02:00
|
|
|
* device, or service. The application specifies the search type by the
|
2008-05-04 21:56:15 +02:00
|
|
|
* \b Target parameter.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
|
|
|
* Note that there is no way for the SDK to distinguish which client
|
|
|
|
* instance issued a particular search. Therefore, the client can get
|
|
|
|
* search callbacks that do not match the original criteria of the search.
|
|
|
|
* Also, the application will receive multiple callbacks for each search.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid control
|
2006-06-06 10:51:22 +02:00
|
|
|
* point handle.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_PARAM: \b Target is \c NULL.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpSearchAsync(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the client performing the search. */
|
|
|
|
IN UpnpClient_Handle Hnd,
|
|
|
|
/*! The time, in seconds, to wait for responses. If the time is greater
|
|
|
|
* than \c MAX_SEARCH_TIME then the time is set to \c MAX_SEARCH_TIME.
|
|
|
|
* If the time is less than \c MIN_SEARCH_TIME then the time is set to
|
|
|
|
* \c MIN_SEARCH_TIME. */
|
|
|
|
IN int Mx,
|
|
|
|
/*! The search target as defined in the UPnP Device Architecture v1.0
|
|
|
|
* specification. */
|
|
|
|
IN const char *Target,
|
|
|
|
/*! The user data to pass when the callback function is invoked. */
|
|
|
|
IN const void *Cookie);
|
|
|
|
|
|
|
|
/*! \b UpnpSendAdvertisement sends out the discovery announcements for
|
2006-06-06 10:51:22 +02:00
|
|
|
* all devices and services for a device. Each announcement is made with
|
|
|
|
* the same expiration time.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \b UpnpSendAdvertisement is a synchronous call.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid
|
2006-06-06 10:51:22 +02:00
|
|
|
* device handle.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: There are insufficient resources to
|
2006-06-06 10:51:22 +02:00
|
|
|
* send future advertisements.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpSendAdvertisement(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The device handle for which to send out the announcements. */
|
|
|
|
IN UpnpDevice_Handle Hnd,
|
|
|
|
/*! The expiration age, in seconds, of the announcements. */
|
|
|
|
IN int Exp);
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2007-05-25 17:02:12 +02:00
|
|
|
/*! @} */ /* Discovery */
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2007-05-25 17:02:12 +02:00
|
|
|
/******************************************************************************
|
|
|
|
******************************************************************************
|
|
|
|
* *
|
|
|
|
* C O N T R O L *
|
|
|
|
* *
|
|
|
|
******************************************************************************
|
|
|
|
******************************************************************************/
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \name Control */
|
2007-05-25 17:02:12 +02:00
|
|
|
/*! @{ */
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \deprecated \b UpnpGetServiceVarStatus queries the state of a state
|
2006-06-06 10:51:22 +02:00
|
|
|
* variable of a service on another device. This is a synchronous call.
|
|
|
|
* A positive return value indicates a SOAP error code, whereas a negative
|
2008-05-04 21:56:15 +02:00
|
|
|
* return code indicates an SDK error code. <b>Note that the use of this
|
|
|
|
* function is deprecated by the UPnP Forum</b>.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid control
|
2006-06-06 10:51:22 +02:00
|
|
|
* point handle.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_URL: \b ActionUrl is not a valid URL.
|
|
|
|
* \li \c UPNP_E_INVALID_DESC: The XML document was not
|
2006-06-06 10:51:22 +02:00
|
|
|
* found or it does not contain a valid XML description.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_PARAM: \b StVarVal is not a valid
|
|
|
|
* pointer or \b VarName or \b ActionUrl is \c NULL.
|
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* complete this operation.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_SOAP_E_INVALID_VAR: The given variable is invalid
|
2006-06-06 10:51:22 +02:00
|
|
|
* according to the device.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpGetServiceVarStatus(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the control point. */
|
|
|
|
IN UpnpClient_Handle Hnd,
|
|
|
|
/*! The URL of the service. */
|
|
|
|
IN const char *ActionURL,
|
|
|
|
/*! The name of the variable to query. */
|
|
|
|
IN const char *VarName,
|
|
|
|
/*! The pointer to store the value for \b VarName. The SDK allocates
|
|
|
|
* this string and the caller needs to free it using
|
|
|
|
* \b ixmlFreeDOMString. */
|
|
|
|
OUT DOMString *StVarVal);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \deprecated \b UpnpGetServiceVarStatusAsync queries the state of a variable of a
|
|
|
|
* service, generating a callback when the operation is complete.
|
|
|
|
* <b>Note that the use of this function is deprecated by the UPnP Forum</b>.
|
|
|
|
*
|
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid control
|
2006-06-06 10:51:22 +02:00
|
|
|
* point handle.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_URL: The \b ActionUrl is not a valid URL.
|
|
|
|
* \li \c UPNP_E_INVALID_PARAM: \b VarName, \b Fun or
|
|
|
|
* \b ActionUrl is not a valid pointer.
|
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* complete this operation.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpGetServiceVarStatusAsync(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the control point. */
|
|
|
|
IN UpnpClient_Handle Hnd,
|
|
|
|
/*! The URL of the service. */
|
|
|
|
IN const char *ActionURL,
|
|
|
|
/*! The name of the variable to query. */
|
|
|
|
IN const char *VarName,
|
|
|
|
/*! Pointer to a callback function to be invoked when the operation
|
|
|
|
* is complete. */
|
|
|
|
IN Upnp_FunPtr Fun,
|
|
|
|
/*! Pointer to user data to pass to the callback function when invoked. */
|
|
|
|
IN const void *Cookie);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpSendAction sends a message to change a state variable
|
2006-06-06 10:51:22 +02:00
|
|
|
* in a service. This is a synchronous call that does not return until the
|
|
|
|
* action is complete.
|
|
|
|
*
|
|
|
|
* Note that a positive return value indicates a SOAP-protocol error code.
|
2008-05-04 21:56:15 +02:00
|
|
|
* In this case, the error description can be retrieved from \b RespNode.
|
2006-06-06 10:51:22 +02:00
|
|
|
* A negative return value indicates an SDK error.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid control
|
2006-06-06 10:51:22 +02:00
|
|
|
* point handle.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_URL: \b ActionUrl is not a valid URL.
|
|
|
|
* \li \c UPNP_E_INVALID_ACTION: This action is not valid.
|
|
|
|
* \li \c UPNP_E_INVALID_DEVICE: \b DevUDN is not a
|
2006-06-06 10:51:22 +02:00
|
|
|
* valid device.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_PARAM: \b ServiceType, \b Action,
|
|
|
|
* \b ActionUrl, or
|
|
|
|
* \b RespNode is not a valid pointer.
|
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* complete this operation.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpSendAction(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the control point sending the action. */
|
|
|
|
IN UpnpClient_Handle Hnd,
|
|
|
|
/*! The action URL of the service. */
|
|
|
|
IN const char *ActionURL,
|
|
|
|
/*! The type of the service. */
|
|
|
|
IN const char *ServiceType,
|
|
|
|
/*! This parameter is ignored and must be \c NULL. */
|
|
|
|
IN const char *DevUDN,
|
|
|
|
/*! The DOM document for the action. */
|
|
|
|
IN IXML_Document *Action,
|
|
|
|
/*! The DOM document for the response to the action. The SDK allocates
|
|
|
|
* this document and the caller needs to free it. */
|
|
|
|
OUT IXML_Document **RespNode);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpSendActionEx sends a message to change a state variable
|
2006-06-06 10:51:22 +02:00
|
|
|
* in a service. This is a synchronous call that does not return until the
|
|
|
|
* action is complete.
|
|
|
|
*
|
|
|
|
* Note that a positive return value indicates a SOAP-protocol error code.
|
2008-05-04 21:56:15 +02:00
|
|
|
* In this case, the error description can be retrieved from \b RespNode.
|
2006-06-06 10:51:22 +02:00
|
|
|
* A negative return value indicates an SDK error.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid control
|
2006-06-06 10:51:22 +02:00
|
|
|
* point handle.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_URL: \b ActionUrl is not a valid URL.
|
|
|
|
* \li \c UPNP_E_INVALID_ACTION: This action is not valid.
|
|
|
|
* \li \c UPNP_E_INVALID_DEVICE: \b DevUDN is not a
|
2006-06-06 10:51:22 +02:00
|
|
|
* valid device.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_PARAM: \b ServiceType, \b Action,
|
|
|
|
* \b ActionUrl, or
|
|
|
|
* \b RespNode is not a valid pointer.
|
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* complete this operation.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpSendActionEx(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the control point sending the action. */
|
|
|
|
IN UpnpClient_Handle Hnd,
|
|
|
|
/*! The action URL of the service. */
|
|
|
|
IN const char *ActionURL,
|
|
|
|
/*! The type of the service. */
|
|
|
|
IN const char *ServiceType,
|
|
|
|
/*! This parameter is ignored and must be \c NULL. */
|
|
|
|
IN const char *DevUDN,
|
|
|
|
/*! The DOM document for the SOAP header. This may be \c NULL if the
|
|
|
|
* header is not required. */
|
|
|
|
IN IXML_Document *Header,
|
|
|
|
/*! The DOM document for the action. */
|
|
|
|
IN IXML_Document *Action,
|
|
|
|
/*! The DOM document for the response to the action. The SDK allocates
|
|
|
|
* this document and the caller needs to free it. */
|
|
|
|
OUT IXML_Document **RespNode);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpSendActionAsync sends a message to change a state variable
|
2006-06-06 10:51:22 +02:00
|
|
|
* in a service, generating a callback when the operation is complete.
|
2008-05-04 21:56:15 +02:00
|
|
|
* See \b UpnpSendAction for comments on positive return values. These
|
2006-06-06 10:51:22 +02:00
|
|
|
* positive return values are sent in the event struct associated with the
|
2008-05-04 21:56:15 +02:00
|
|
|
* \c UPNP_CONTROL_ACTION_COMPLETE event.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid control
|
2006-06-06 10:51:22 +02:00
|
|
|
* point handle.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_URL: \b ActionUrl is an invalid URL.
|
|
|
|
* \li \c UPNP_E_INVALID_DEVICE: \b DevUDN is an invalid device.
|
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b Fun is not a valid
|
|
|
|
* callback function or \b ServiceType, \b Act, or
|
|
|
|
* \b ActionUrl is \c NULL.
|
|
|
|
* \li \c UPNP_E_INVALID_ACTION: This action is not valid.
|
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* complete this operation.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpSendActionAsync(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the control point sending the action. */
|
|
|
|
IN UpnpClient_Handle Hnd,
|
|
|
|
/*! The action URL of the service. */
|
|
|
|
IN const char *ActionURL,
|
|
|
|
/*! The type of the service. */
|
|
|
|
IN const char *ServiceType,
|
|
|
|
/*! This parameter is ignored and must be \c NULL. */
|
|
|
|
IN const char *DevUDN,
|
|
|
|
/*! The DOM document for the action to perform on this device. */
|
|
|
|
IN IXML_Document *Action,
|
|
|
|
/*! Pointer to a callback function to be invoked when the operation
|
|
|
|
* completes. */
|
|
|
|
IN Upnp_FunPtr Fun,
|
|
|
|
/*! Pointer to user data that to be passed to the callback when
|
|
|
|
* invoked. */
|
|
|
|
IN const void *Cookie);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpSendActionExAsync sends a message to change a state variable
|
2006-06-06 10:51:22 +02:00
|
|
|
* in a service, generating a callback when the operation is complete.
|
2008-05-04 21:56:15 +02:00
|
|
|
* See \b UpnpSendAction for comments on positive return values. These
|
2006-06-06 10:51:22 +02:00
|
|
|
* positive return values are sent in the event struct associated with the
|
2008-05-04 21:56:15 +02:00
|
|
|
* \c UPNP_CONTROL_ACTION_COMPLETE event.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid control
|
2006-06-06 10:51:22 +02:00
|
|
|
* point handle.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_URL: \b ActionUrl is an invalid URL.
|
|
|
|
* \li \c UPNP_E_INVALID_DEVICE: \b DevUDN is an invalid device.
|
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b Fun is not a valid
|
|
|
|
* callback function or \b ServiceType, \b Act, or
|
|
|
|
* \b ActionUrl is \c NULL.
|
|
|
|
* \li \c UPNP_E_INVALID_ACTION: This action is not valid.
|
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* complete this operation.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpSendActionExAsync(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the control point sending the action. */
|
|
|
|
IN UpnpClient_Handle Hnd,
|
|
|
|
/*! The action URL of the service. */
|
|
|
|
IN const char *ActionURL,
|
|
|
|
/*! The type of the service. */
|
|
|
|
IN const char *ServiceType,
|
|
|
|
/*! This parameter is ignored and must be \c NULL. */
|
|
|
|
IN const char *DevUDN,
|
|
|
|
/*! The DOM document for the SOAP header. This may be \c NULL if the
|
|
|
|
* header is not required. */
|
|
|
|
IN IXML_Document *Header,
|
|
|
|
/*! The DOM document for the action to perform on this device. */
|
|
|
|
IN IXML_Document *Action,
|
|
|
|
/*! Pointer to a callback function to be invoked when the operation
|
|
|
|
* completes. */
|
|
|
|
IN Upnp_FunPtr Fun,
|
|
|
|
/*! Pointer to user data that to be passed to the callback when
|
|
|
|
* invoked. */
|
|
|
|
IN const void *Cookie);
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2007-05-25 17:02:12 +02:00
|
|
|
/*! @} */ /* Control */
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2007-05-25 17:02:12 +02:00
|
|
|
/******************************************************************************
|
|
|
|
******************************************************************************
|
|
|
|
* *
|
|
|
|
* E V E N T I N G *
|
|
|
|
* *
|
|
|
|
******************************************************************************
|
|
|
|
******************************************************************************/
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \name Eventing */
|
2007-05-25 17:02:12 +02:00
|
|
|
/*! @{ */
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \b UpnpAcceptSubscription accepts a subscription request and sends
|
2006-06-06 10:51:22 +02:00
|
|
|
* out the current state of the eventable variables for a service.
|
|
|
|
* The device application should call this function when it receives a
|
2008-05-04 21:56:15 +02:00
|
|
|
* \c UPNP_EVENT_SUBSCRIPTION_REQUEST callback. This function is
|
2006-06-06 10:51:22 +02:00
|
|
|
* synchronous and generates no callbacks.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \b UpnpAcceptSubscription can be called during the execution of
|
2006-06-06 10:51:22 +02:00
|
|
|
* a callback function.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid device
|
2006-06-06 10:51:22 +02:00
|
|
|
* handle.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_SERVICE: The \b DevId/\b ServId
|
2006-06-06 10:51:22 +02:00
|
|
|
* pair refers to an invalid service.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_SID: The specified subscription ID is not
|
2006-06-06 10:51:22 +02:00
|
|
|
* valid.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b VarName,
|
|
|
|
* \b NewVal, \b DevID, or \b ServID is not a valid
|
|
|
|
* pointer or \b cVariables is less than zero.
|
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* complete this operation.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpAcceptSubscription(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the device. */
|
2008-05-03 23:19:08 +02:00
|
|
|
IN UpnpDevice_Handle Hnd,
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The device ID of the subdevice of the service generating the event. */
|
2008-05-03 23:19:08 +02:00
|
|
|
IN const char *DevID,
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The unique service identifier of the service generating the event. */
|
2008-05-03 23:19:08 +02:00
|
|
|
IN const char *ServID,
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Pointer to an array of event variables. */
|
2008-05-03 23:19:08 +02:00
|
|
|
IN const char **VarName,
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Pointer to an array of values for the event variables. */
|
2008-05-03 23:19:08 +02:00
|
|
|
IN const char **NewVal,
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The number of event variables in \b VarName. */
|
2008-05-03 23:19:08 +02:00
|
|
|
IN int cVariables,
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The subscription ID of the newly registered control point. */
|
2008-05-03 23:19:08 +02:00
|
|
|
IN const Upnp_SID SubsId);
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \b UpnpAcceptSubscriptionExt is similar to \b UpnpAcceptSubscription
|
2006-06-06 10:51:22 +02:00
|
|
|
* except that it takes a DOM document for the variables to event rather
|
|
|
|
* than an array of strings. This function is sychronous
|
|
|
|
* and generates no callbacks.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \b UpnpAcceptSubscriptionExt can be called during the execution of
|
2006-06-06 10:51:22 +02:00
|
|
|
* a callback function.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid device
|
2006-06-06 10:51:22 +02:00
|
|
|
* handle.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_SERVICE: The \b DevId/\b ServId
|
2006-06-06 10:51:22 +02:00
|
|
|
* pair refers to an invalid service.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_SID: The specified subscription ID is not
|
2006-06-06 10:51:22 +02:00
|
|
|
* valid.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b VarName,
|
|
|
|
* \b NewVal, \b DevID, \b ServID, or \b PropSet
|
2006-06-06 10:51:22 +02:00
|
|
|
* is not a valid pointer.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* complete this operation.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpAcceptSubscriptionExt(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the device. */
|
|
|
|
IN UpnpDevice_Handle Hnd,
|
|
|
|
/*! The device ID of the subdevice of the service generating the event. */
|
|
|
|
IN const char *DevID,
|
|
|
|
/*! The unique service identifier of the service generating the event. */
|
|
|
|
IN const char *ServID,
|
|
|
|
/*! The DOM document for the property set. Property set documents must
|
|
|
|
* conform to the XML schema defined in section 4.3 of the Universal
|
|
|
|
* Plug and Play Device Architecture specification. */
|
|
|
|
IN IXML_Document *PropSet,
|
|
|
|
/*! The subscription ID of the newly registered control point. */
|
|
|
|
IN Upnp_SID SubsId);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpNotify sends out an event change notification to all
|
2006-06-06 10:51:22 +02:00
|
|
|
* control points subscribed to a particular service. This function is
|
|
|
|
* synchronous and generates no callbacks.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \b UpnpNotify may be called during a callback function to send out
|
2006-06-06 10:51:22 +02:00
|
|
|
* a notification.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid device
|
2006-06-06 10:51:22 +02:00
|
|
|
* handle.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_SERVICE: The \b DevId/\b ServId
|
2006-06-06 10:51:22 +02:00
|
|
|
* pair refers to an invalid service.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b VarName, \b NewVal,
|
|
|
|
* \b DevID, or \b ServID is not a valid pointer or
|
|
|
|
* \b cVariables is less than zero.
|
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* complete this operation.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpNotify(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle to the device sending the event. */
|
|
|
|
IN UpnpDevice_Handle,
|
|
|
|
/*! The device ID of the subdevice of the service generating the event. */
|
|
|
|
IN const char *DevID,
|
|
|
|
/*! The unique identifier of the service generating the event. */
|
|
|
|
IN const char *ServID,
|
|
|
|
/*! Pointer to an array of variables that have changed. */
|
|
|
|
IN const char **VarName,
|
|
|
|
/*! Pointer to an array of new values for those variables. */
|
|
|
|
IN const char **NewVal,
|
|
|
|
/*! The count of variables included in this notification. */
|
|
|
|
IN int cVariables);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpNotifyExt is similar to \b UpnpNotify except that it takes
|
2006-06-06 10:51:22 +02:00
|
|
|
* a DOM document for the event rather than an array of strings. This
|
|
|
|
* function is synchronous and generates no callbacks.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \b UpnpNotifyExt may be called during a callback function to send out
|
2006-06-06 10:51:22 +02:00
|
|
|
* a notification.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid device
|
2006-06-06 10:51:22 +02:00
|
|
|
* handle.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_SERVICE: The \b DevId/\b ServId
|
2006-06-06 10:51:22 +02:00
|
|
|
* pair refers to an invalid service.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b VarName, \b NewVal,
|
|
|
|
* \b DevID, \b ServID, or \b PropSet
|
|
|
|
* is not a valid pointer or \b cVariables is less than zero.
|
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* complete this operation.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpNotifyExt(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle to the device sending the event. */
|
|
|
|
IN UpnpDevice_Handle,
|
|
|
|
/*! The device ID of the subdevice of the service generating the event. */
|
|
|
|
IN const char *DevID,
|
|
|
|
/*! The unique identifier of the service generating the event. */
|
|
|
|
IN const char *ServID,
|
|
|
|
/*! The DOM document for the property set. Property set documents must
|
|
|
|
* conform to the XML schema defined in section 4.3 of the Universal
|
|
|
|
* Plug and Play Device Architecture specification. */
|
|
|
|
IN IXML_Document *PropSet);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpRenewSubscription renews a subscription that is about to
|
2006-06-06 10:51:22 +02:00
|
|
|
* expire. This function is synchronous.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid control
|
2006-06-06 10:51:22 +02:00
|
|
|
* point handle.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_PARAM: \b Timeout is not a valid pointer.
|
|
|
|
* \li \c UPNP_E_INVALID_SID: The SID being passed to this function
|
2006-06-06 10:51:22 +02:00
|
|
|
* is not a valid subscription ID.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_NETWORK_ERROR: A network error occured.
|
|
|
|
* \li \c UPNP_E_SOCKET_WRITE: An error or timeout occurred writing
|
2006-06-06 10:51:22 +02:00
|
|
|
* to a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_READ: An error or timeout occurred reading
|
2006-06-06 10:51:22 +02:00
|
|
|
* from a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_BIND: An error occurred binding a socket.
|
|
|
|
* \li \c UPNP_E_SOCKET_CONNECT: An error occurred connecting to
|
|
|
|
* \b PublisherUrl.
|
|
|
|
* \li \c UPNP_E_OUTOF_SOCKET: An error occurred creating a socket.
|
|
|
|
* \li \c UPNP_E_BAD_RESPONSE: An error occurred in response from
|
2006-06-06 10:51:22 +02:00
|
|
|
* the publisher.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SUBSCRIBE_UNACCEPTED: The publisher refused
|
2006-06-06 10:51:22 +02:00
|
|
|
* the subscription renew.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* complete this operation.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpRenewSubscription(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the control point that is renewing the subscription. */
|
|
|
|
IN UpnpClient_Handle Hnd,
|
|
|
|
/*! Pointer to a variable containing the requested subscription time.
|
|
|
|
* Upon return, it contains the actual renewal time. */
|
|
|
|
INOUT int *TimeOut,
|
|
|
|
/*! The ID for the subscription to renew. */
|
|
|
|
IN const Upnp_SID SubsId);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpRenewSubscriptionAsync renews a subscription that is about
|
2006-06-06 10:51:22 +02:00
|
|
|
* to expire, generating a callback when the operation is complete.
|
|
|
|
*
|
|
|
|
* Note that many of the error codes for this function are returned in
|
2008-05-04 21:56:15 +02:00
|
|
|
* the \b UpnpEventSubscribe structure. In those cases, the function
|
|
|
|
* returns \c UPNP_E_SUCCESS and the appropriate error code will
|
|
|
|
* be in the <b>UpnpEventSubscribe.ErrCode</b> field in the \b Event
|
2006-06-06 10:51:22 +02:00
|
|
|
* structure passed to the callback.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid control
|
2006-06-06 10:51:22 +02:00
|
|
|
* point handle.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_SID: The \b SubsId is not a valid
|
2006-06-06 10:51:22 +02:00
|
|
|
* subscription ID.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b Fun is not a valid
|
|
|
|
* callback function pointer or \b Timeout is less than zero
|
|
|
|
* but is not \c UPNP_INFINITE.
|
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* complete this operation.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_NETWORK_ERROR: A network error occured (returned in
|
|
|
|
* the <b>UpnpEventSubscribe.ErrCode</b> field as part of the
|
2006-06-06 10:51:22 +02:00
|
|
|
* callback).
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_WRITE: An error or timeout occurred writing
|
|
|
|
* to a socket (returned in the <b>UpnpEventSubscribe.ErrCode</b>
|
2006-06-06 10:51:22 +02:00
|
|
|
* field as part of the callback).
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_READ: An error or timeout occurred reading
|
2006-06-06 10:51:22 +02:00
|
|
|
* from a socket (returned in the
|
2008-05-04 21:56:15 +02:00
|
|
|
* <b>UpnpEventSubscribe.ErrCode</b> field as part of the
|
2006-06-06 10:51:22 +02:00
|
|
|
* callback).
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_BIND: An error occurred binding the socket
|
|
|
|
* (returned in the <b>UpnpEventSubscribe.ErrCode</b> field as
|
2006-06-06 10:51:22 +02:00
|
|
|
* part of the callback).
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_CONNECT: An error occurred connecting to
|
|
|
|
* \b PublisherUrl (returned in the \b
|
|
|
|
* UpnpEventSubscribe.ErrCode field as part of the callback).
|
|
|
|
* \li \c UPNP_E_OUTOF_SOCKET: An error occurred creating socket (
|
|
|
|
* returned in the <b>UpnpEventSubscribe.ErrCode</b> field as
|
2006-06-06 10:51:22 +02:00
|
|
|
* part of the callback).
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_BAD_RESPONSE: An error occurred in response from
|
|
|
|
* the publisher (returned in the \b
|
|
|
|
* UpnpEventSubscribe.ErrCode field as part of the callback).
|
|
|
|
* \li \c UPNP_E_SUBSCRIBE_UNACCEPTED: The publisher refused
|
|
|
|
* the subscription request (returned in the \b
|
|
|
|
* UpnpEventSubscribe.ErrCode field as part of the callback).
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpRenewSubscriptionAsync(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the control point that is renewing the subscription. */
|
|
|
|
IN UpnpClient_Handle Hnd,
|
|
|
|
/*! The requested subscription time. The actual timeout value is
|
|
|
|
* returned when the callback function is called. */
|
|
|
|
IN int TimeOut,
|
|
|
|
/*! The ID for the subscription to renew. */
|
|
|
|
IN Upnp_SID SubsId,
|
|
|
|
/*! Pointer to a callback function to be invoked when the renewal is
|
|
|
|
* complete. */
|
|
|
|
IN Upnp_FunPtr Fun,
|
|
|
|
/*! Pointer to user data passed to the callback function when invoked. */
|
|
|
|
IN const void *Cookie);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpSetMaxSubscriptions sets the maximum number of subscriptions
|
2006-06-06 10:51:22 +02:00
|
|
|
* accepted per service. The default value accepts as many as system
|
|
|
|
* resources allow. If the number of current subscriptions for a service is
|
|
|
|
* greater than the requested value, the SDK accepts no new
|
|
|
|
* subscriptions or renewals, however, the SDK does not remove
|
|
|
|
* any current subscriptions.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid device
|
2006-06-06 10:51:22 +02:00
|
|
|
* handle.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpSetMaxSubscriptions(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the device for which the maximum number of
|
|
|
|
* subscriptions is being set. */
|
|
|
|
IN UpnpDevice_Handle Hnd,
|
|
|
|
/*! The maximum number of subscriptions to be allowed per service. */
|
|
|
|
IN int MaxSubscriptions);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpSetMaxSubscriptionTimeOut sets the maximum time-out accepted
|
2006-06-06 10:51:22 +02:00
|
|
|
* for a subscription request or renewal. The default value accepts the
|
|
|
|
* time-out set by the control point. If a control point requests a
|
|
|
|
* subscription time-out less than or equal to the maximum, the SDK
|
|
|
|
* grants the value requested by the control point. If the time-out
|
|
|
|
* is greater, the SDK returns the maximum value.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid device
|
2006-06-06 10:51:22 +02:00
|
|
|
* handle.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpSetMaxSubscriptionTimeOut(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the device for which the maximum subscription
|
|
|
|
* time-out is being set. */
|
|
|
|
IN UpnpDevice_Handle Hnd,
|
|
|
|
/*! The maximum subscription time-out to be accepted. */
|
|
|
|
IN int MaxSubscriptionTimeOut);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpSubscribe registers a control point to receive event
|
2006-06-06 10:51:22 +02:00
|
|
|
* notifications from another device. This operation is synchronous.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid control
|
2006-06-06 10:51:22 +02:00
|
|
|
* point handle.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_URL: \b PublisherUrl is not a valid URL.
|
|
|
|
* \li \c UPNP_E_INVALID_PARAM: \b Timeout is not a valid pointer
|
|
|
|
* or \b SubsId or \b PublisherUrl is \c NULL.
|
|
|
|
* \li \c UPNP_E_NETWORK_ERROR: A network error occured.
|
|
|
|
* \li \c UPNP_E_SOCKET_WRITE: An error or timeout occurred writing
|
2006-06-06 10:51:22 +02:00
|
|
|
* to a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_READ: An error or timeout occurred reading
|
2006-06-06 10:51:22 +02:00
|
|
|
* from a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_BIND: An error occurred binding a socket.
|
|
|
|
* \li \c UPNP_E_SOCKET_CONNECT: An error occurred connecting to
|
|
|
|
* \b PublisherUrl.
|
|
|
|
* \li \c UPNP_E_OUTOF_SOCKET: An error occurred creating a socket.
|
|
|
|
* \li \c UPNP_E_BAD_RESPONSE: An error occurred in response from
|
2006-06-06 10:51:22 +02:00
|
|
|
* the publisher.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SUBSCRIBE_UNACCEPTED: The publisher refused
|
2006-06-06 10:51:22 +02:00
|
|
|
* the subscription request.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* complete this operation.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpSubscribe(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the control point. */
|
|
|
|
IN UpnpClient_Handle Hnd,
|
|
|
|
/*! The URL of the service to subscribe to. */
|
|
|
|
IN const char *PublisherUrl,
|
|
|
|
/*! Pointer to a variable containing the requested subscription time.
|
|
|
|
* Upon return, it contains the actual subscription time returned from
|
|
|
|
* the service. */
|
|
|
|
INOUT int *TimeOut,
|
|
|
|
/*! Pointer to a variable to receive the subscription ID (SID). */
|
|
|
|
OUT Upnp_SID SubsId);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief Performs the same operation as \b UpnpSubscribe, but returns
|
|
|
|
* immediately and calls the registered callback function when the operation
|
|
|
|
* is complete.
|
|
|
|
*
|
|
|
|
* Note that many of the error codes for this function are returned in
|
|
|
|
* the \b UpnpEventSubscribe structure. In those cases, the function
|
|
|
|
* returns \c UPNP_E_SUCCESS and the appropriate error code will
|
|
|
|
* be in the <b>UpnpEventSubscribe.ErrCode</b> field in the \b Event
|
|
|
|
* structure passed to the callback.
|
|
|
|
*
|
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid control
|
2006-06-06 10:51:22 +02:00
|
|
|
* point handle.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_URL: The \b PublisherUrl is not a valid
|
2006-06-06 10:51:22 +02:00
|
|
|
* URL.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b TimeOut or \b Fun or
|
|
|
|
* \b PublisherUrl is not a valid pointer.
|
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* complete this operation.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_NETWORK_ERROR: A network error occured (returned in
|
|
|
|
* the <b>UpnpEventSubscribe.ErrCode</b> field as part of the
|
2006-06-06 10:51:22 +02:00
|
|
|
* callback).
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_WRITE: An error or timeout occurred writing
|
2006-06-06 10:51:22 +02:00
|
|
|
* to a socket (returned in the
|
2008-05-04 21:56:15 +02:00
|
|
|
* <b>UpnpEventSubscribe.ErrCode</b> field as part of the
|
2006-06-06 10:51:22 +02:00
|
|
|
* callback).
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_READ: An error or timeout occurred reading
|
2006-06-06 10:51:22 +02:00
|
|
|
* from a socket (returned in the
|
2008-05-04 21:56:15 +02:00
|
|
|
* <b>UpnpEventSubscribe.ErrCode</b> field as part of the
|
2006-06-06 10:51:22 +02:00
|
|
|
* callback).
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_BIND: An error occurred binding the socket
|
|
|
|
* (returned in the <b>UpnpEventSubscribe.ErrCode</b> field as
|
2006-06-06 10:51:22 +02:00
|
|
|
* part of the callback).
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_CONNECT: An error occurred connecting to
|
|
|
|
* \b PublisherUrl (returned in the \b
|
|
|
|
* UpnpEventSubscribe.ErrCode field as part of the callback).
|
|
|
|
* \li \c UPNP_E_OUTOF_SOCKET: An error occurred creating the
|
|
|
|
* socket (returned in the <b>UpnpEventSubscribe.ErrCode</b>
|
2006-06-06 10:51:22 +02:00
|
|
|
* field as part of the callback).
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_BAD_RESPONSE: An error occurred in response from
|
|
|
|
* the publisher (returned in the \b
|
|
|
|
* UpnpEventSubscribe.ErrCode field as part of the callback).
|
|
|
|
* \li \c UPNP_E_SUBSCRIBE_UNACCEPTED: The publisher refused
|
|
|
|
* the subscription request (returned in the \b
|
|
|
|
* UpnpEventSubscribe.ErrCode field as part of the callback).
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpSubscribeAsync(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the control point that is subscribing. */
|
|
|
|
IN UpnpClient_Handle Hnd,
|
|
|
|
/*! The URL of the service to subscribe to. */
|
|
|
|
IN const char *PublisherUrl,
|
|
|
|
/*! The requested subscription time. Upon return, it contains the actual
|
|
|
|
* subscription time returned from the service. */
|
|
|
|
IN int TimeOut,
|
|
|
|
/*! Pointer to the callback function for this subscribe request. */
|
|
|
|
IN Upnp_FunPtr Fun,
|
|
|
|
/*! A user data value passed to the callback function when invoked. */
|
|
|
|
IN const void *Cookie);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpUnSubscribe removes the subscription of a control point from a
|
|
|
|
* service previously subscribed to using \b UpnpSubscribe or
|
|
|
|
* \b UpnpSubscribeAsync. This is a synchronous call.
|
|
|
|
*
|
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid control
|
2006-06-06 10:51:22 +02:00
|
|
|
* point handle.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_SID: The \b SubsId is not a valid
|
2006-06-06 10:51:22 +02:00
|
|
|
* subscription ID.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_NETWORK_ERROR: A network error occured.
|
|
|
|
* \li \c UPNP_E_SOCKET_WRITE: An error or timeout occurred writing
|
2006-06-06 10:51:22 +02:00
|
|
|
* to a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_READ: An error or timeout occurred reading
|
2006-06-06 10:51:22 +02:00
|
|
|
* from a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_BIND: An error occurred binding a socket.
|
|
|
|
* \li \c UPNP_E_SOCKET_CONNECT: An error occurred connecting to
|
|
|
|
* \b PublisherUrl.
|
|
|
|
* \li \c UPNP_E_OUTOF_SOCKET: An error ocurred creating a socket.
|
|
|
|
* \li \c UPNP_E_BAD_RESPONSE: An error occurred in response from
|
2006-06-06 10:51:22 +02:00
|
|
|
* the publisher.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_UNSUBSCRIBE_UNACCEPTED: The publisher refused
|
2006-06-06 10:51:22 +02:00
|
|
|
* the unsubscribe request (the client is still unsubscribed and
|
|
|
|
* no longer receives events).
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* complete this operation.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpUnSubscribe(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the subscribed control point. */
|
|
|
|
IN UpnpClient_Handle Hnd,
|
|
|
|
/*! The ID returned when the control point subscribed to the service. */
|
|
|
|
IN const Upnp_SID SubsId);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpUnSubscribeAsync removes a subscription of a control
|
|
|
|
* point from a service previously subscribed to using \b
|
|
|
|
* UpnpSubscribe or \b UpnpSubscribeAsync, generating a callback
|
2006-06-06 10:51:22 +02:00
|
|
|
* when the operation is complete.
|
|
|
|
*
|
|
|
|
* Note that many of the error codes for this function are returned in
|
2008-05-04 21:56:15 +02:00
|
|
|
* the \b UpnpEventSubscribe structure. In those cases, the function
|
|
|
|
* returns \c UPNP_E_SUCCESS and the appropriate error code will
|
|
|
|
* be in the <b>UpnpEventSubscribe.ErrCode</b> field in the \b Event
|
2006-06-06 10:51:22 +02:00
|
|
|
* structure passed to the callback.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_HANDLE}: The handle is not a valid control
|
2006-06-06 10:51:22 +02:00
|
|
|
* point handle.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_SID: The \b SubsId is not a valid SID.
|
|
|
|
* \li \c UPNP_E_INVALID_PARAM: \b Fun is not a valid callback
|
2006-06-06 10:51:22 +02:00
|
|
|
* function pointer.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* complete this operation.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_NETWORK_ERROR: A network error occured (returned in
|
|
|
|
* the <b>UpnpEventSubscribe.ErrCode</b> field as part of the
|
2006-06-06 10:51:22 +02:00
|
|
|
* callback).
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_WRITE: An error or timeout occurred writing
|
|
|
|
* to a socket (returned in the <b>UpnpEventSubscribe.ErrCode</b>
|
|
|
|
* field as part of the callback).
|
|
|
|
* \li \c UPNP_E_SOCKET_READ: An error or timeout occurred reading
|
2006-06-06 10:51:22 +02:00
|
|
|
* from a socket (returned in the
|
2008-05-04 21:56:15 +02:00
|
|
|
* <b>UpnpEventSubscribe.ErrCode</b> field as part of the
|
2006-06-06 10:51:22 +02:00
|
|
|
* callback).
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_BIND: An error occurred binding the socket
|
|
|
|
* (returned in the <b>UpnpEventSubscribe.ErrCode</b> field as
|
2006-06-06 10:51:22 +02:00
|
|
|
* part of the callback).
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_CONNECT: An error occurred connecting to
|
|
|
|
* \b PublisherUrl (returned in the <b>UpnpEventSubscribe.ErrCode</b>
|
|
|
|
* field as part of the callback).
|
|
|
|
* \li \c UPNP_E_OUTOF_SOCKET: An error occurred creating a socket (
|
|
|
|
* returned in the <b>UpnpEventSubscribe.ErrCode</b> field as
|
2006-06-06 10:51:22 +02:00
|
|
|
* part of the callback).
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_BAD_RESPONSE: An error occurred in response from
|
|
|
|
* the publisher (returned in the <b>UpnpEventSubscribe.ErrCode</b>
|
|
|
|
* field as part of the callback).
|
|
|
|
* \li \c UPNP_E_UNSUBSCRIBE_UNACCEPTED: The publisher refused
|
|
|
|
* the subscription request (returned in the
|
|
|
|
* <b>UpnpEventSubscribe.ErrCode</b> field as part of the callback).
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpUnSubscribeAsync(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the subscribed control point. */
|
|
|
|
IN UpnpClient_Handle Hnd,
|
|
|
|
/*! The ID returned when the control point subscribed to the service. */
|
|
|
|
IN Upnp_SID SubsId,
|
|
|
|
/*! Pointer to a callback function to be called when the operation is
|
|
|
|
* complete. */
|
|
|
|
IN Upnp_FunPtr Fun,
|
|
|
|
/*! Pointer to user data to pass to the callback function when invoked. */
|
|
|
|
IN const void *Cookie);
|
|
|
|
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2007-05-25 17:02:12 +02:00
|
|
|
/*! @} */ /* Eventing */
|
2006-06-06 10:51:22 +02:00
|
|
|
|
|
|
|
|
2007-05-25 17:02:12 +02:00
|
|
|
/******************************************************************************
|
|
|
|
******************************************************************************
|
|
|
|
* *
|
|
|
|
* C L I E N T - A P I *
|
|
|
|
* *
|
|
|
|
******************************************************************************
|
|
|
|
******************************************************************************/
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \name Control Point HTTP API */
|
2007-05-25 17:02:12 +02:00
|
|
|
/*! @{ */
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \b UpnpDownloadUrlItem downloads a file specified in a URL.
|
|
|
|
* The SDK allocates the memory for \b outBuf and the
|
2006-06-06 10:51:22 +02:00
|
|
|
* application is responsible for freeing this memory. Note that
|
|
|
|
* the item is passed as a single buffer. Large items should not
|
|
|
|
* be transferred using this function.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b url, \b outBuf
|
|
|
|
* or \b contentType is not a valid pointer.
|
|
|
|
* \li \c UPNP_E_INVALID_URL: The \b url is not a valid
|
2006-06-06 10:51:22 +02:00
|
|
|
* URL.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* download this file.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_NETWORK_ERROR: A network error occurred.
|
|
|
|
* \li \c UPNP_E_SOCKET_WRITE: An error or timeout occurred writing
|
2006-06-06 10:51:22 +02:00
|
|
|
* to a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_READ: An error or timeout occurred reading
|
2006-06-06 10:51:22 +02:00
|
|
|
* from a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_BIND: An error occurred binding a socket.
|
|
|
|
* \li \c UPNP_E_SOCKET_CONNECT: An error occurred connecting a
|
2006-06-06 10:51:22 +02:00
|
|
|
* socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_SOCKET: Too many sockets are currently
|
2006-06-06 10:51:22 +02:00
|
|
|
* allocated.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpDownloadUrlItem(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! URL of an item to download. */
|
|
|
|
IN const char *url,
|
|
|
|
/*! Buffer to store the downloaded item. */
|
|
|
|
OUT char **outBuf,
|
|
|
|
/*! HTTP header value content type if present. It should be at least
|
|
|
|
* \c LINE_SIZE bytes in size. */
|
|
|
|
OUT char *contentType);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpOpenHttpGet gets a file specified in a URL.
|
|
|
|
* The SDK allocates the memory for \b handle and
|
|
|
|
* \b contentType, the application is responsible for freeing this memory.
|
|
|
|
*
|
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b url, \b handle,
|
|
|
|
* \b contentType, \b contentLength or \b httpStatus
|
2006-06-06 10:51:22 +02:00
|
|
|
* is not a valid pointer.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_URL: The \b url is not a valid
|
2006-06-06 10:51:22 +02:00
|
|
|
* URL.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* download this file.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_NETWORK_ERROR: A network error occurred.
|
|
|
|
* \li \c UPNP_E_SOCKET_WRITE: An error or timeout occurred writing
|
2006-06-06 10:51:22 +02:00
|
|
|
* to a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_READ: An error or timeout occurred reading
|
2006-06-06 10:51:22 +02:00
|
|
|
* from a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_BIND: An error occurred binding a socket.
|
|
|
|
* \li \c UPNP_E_SOCKET_CONNECT: An error occurred connecting a
|
2006-06-06 10:51:22 +02:00
|
|
|
* socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_SOCKET: Too many sockets are currently
|
2006-06-06 10:51:22 +02:00
|
|
|
* allocated.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_BAD_RESPONSE: A bad response was received from the
|
2006-06-06 10:51:22 +02:00
|
|
|
* remote server.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpOpenHttpGet(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The URL of an item to get. */
|
|
|
|
IN const char *url,
|
|
|
|
/*! A pointer to store the handle for this connection. */
|
|
|
|
IN OUT void **handle,
|
|
|
|
/*! A buffer to store the media type of the item. */
|
|
|
|
IN OUT char **contentType,
|
|
|
|
/*! A pointer to store the length of the item. */
|
|
|
|
IN OUT int *contentLength,
|
|
|
|
/*! The status returned on receiving a response message. */
|
|
|
|
IN OUT int *httpStatus,
|
|
|
|
/*! The time out value sent with the request during which a response
|
|
|
|
* is expected from the server, failing which, an error is reported
|
|
|
|
* back to the user. */
|
|
|
|
IN int timeout);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpOpenHttpGetProxy gets a file specified in a URL through the
|
2006-06-06 10:51:22 +02:00
|
|
|
* specified proxy.
|
2008-05-04 21:56:15 +02:00
|
|
|
* The SDK allocates the memory for \b handle and
|
|
|
|
* \b contentType, the application is responsible for freeing this memory.
|
|
|
|
*
|
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b url, \b handle,
|
|
|
|
* \b contentType, \b contentLength or \b httpStatus
|
2006-06-06 10:51:22 +02:00
|
|
|
* is not a valid pointer.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_URL: The \b url is not a valid
|
2006-06-06 10:51:22 +02:00
|
|
|
* URL.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* download this file.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_NETWORK_ERROR: A network error occurred.
|
|
|
|
* \li \c UPNP_E_SOCKET_WRITE: An error or timeout occurred writing
|
2006-06-06 10:51:22 +02:00
|
|
|
* to a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_READ: An error or timeout occurred reading
|
2006-06-06 10:51:22 +02:00
|
|
|
* from a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_BIND: An error occurred binding a socket.
|
|
|
|
* \li \c UPNP_E_SOCKET_CONNECT: An error occurred connecting a
|
2006-06-06 10:51:22 +02:00
|
|
|
* socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_SOCKET: Too many sockets are currently
|
2006-06-06 10:51:22 +02:00
|
|
|
* allocated.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_BAD_RESPONSE: A bad response was received from the
|
2006-06-06 10:51:22 +02:00
|
|
|
* remote server.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpOpenHttpGetProxy(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The URL of an item to get. */
|
|
|
|
IN const char *url,
|
|
|
|
/*! The URL of the proxy. */
|
|
|
|
IN const char *proxy_str,
|
|
|
|
/*! A pointer to store the handle for this connection. */
|
|
|
|
IN OUT void **handle,
|
|
|
|
/*! A buffer to store the media type of the item. */
|
|
|
|
IN OUT char **contentType,
|
|
|
|
/*! A pointer to store the length of the item. */
|
|
|
|
IN OUT int *contentLength,
|
|
|
|
/*! The status returned on receiving a response message. */
|
|
|
|
IN OUT int *httpStatus,
|
|
|
|
/*! The time out value sent with the request during which a response
|
|
|
|
* is expected from the server, failing which, an error is reported
|
|
|
|
* back to the user. */
|
|
|
|
IN int timeout);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpOpenHttpGetEx gets specified number of bytes from a file
|
2006-06-06 10:51:22 +02:00
|
|
|
* specified in the URL. The number of bytes is specified through a low
|
|
|
|
* count and a high count which are passed as a range of bytes for the
|
2008-05-04 21:56:15 +02:00
|
|
|
* request. The SDK allocates the memory for \b handle and
|
|
|
|
* \b contentType, the application is responsible for freeing this memory.
|
|
|
|
*
|
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b url, \b handle,
|
|
|
|
* \b contentType, \b contentLength or \b httpStatus
|
2006-06-06 10:51:22 +02:00
|
|
|
* is not a valid pointer.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_URL: The \b url is not a valid
|
2006-06-06 10:51:22 +02:00
|
|
|
* URL.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* download this file.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_NETWORK_ERROR: A network error occurred.
|
|
|
|
* \li \c UPNP_E_SOCKET_WRITE: An error or timeout occurred writing
|
2006-06-06 10:51:22 +02:00
|
|
|
* to a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_READ: An error or timeout occurred reading
|
2006-06-06 10:51:22 +02:00
|
|
|
* from a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_BIND: An error occurred binding a socket.
|
|
|
|
* \li \c UPNP_E_SOCKET_CONNECT: An error occurred connecting a
|
2006-06-06 10:51:22 +02:00
|
|
|
* socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_SOCKET: Too many sockets are currently
|
2006-06-06 10:51:22 +02:00
|
|
|
* allocated.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_BAD_RESPONSE: A bad response was received from the
|
2006-06-06 10:51:22 +02:00
|
|
|
* remote server.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpOpenHttpGetEx(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The URL of the item to get. */
|
|
|
|
IN const char *url,
|
|
|
|
/*! A pointer to store the handle for this connection. */
|
|
|
|
IN OUT void **handle,
|
|
|
|
/*! A buffer to store the media type of the item. */
|
|
|
|
IN OUT char **contentType,
|
|
|
|
/*! A buffer to store the length of the item. */
|
|
|
|
IN OUT int *contentLength,
|
|
|
|
/*! The status returned on receiving a response message from the remote server. */
|
|
|
|
IN OUT int *httpStatus,
|
|
|
|
/*! An integer value representing the low end of a range to retrieve. */
|
|
|
|
IN int lowRange,
|
|
|
|
/*! An integer value representing the high end of a range to retrieve. */
|
|
|
|
IN int highRange,
|
|
|
|
/*! A time out value sent with the request during which a response is
|
|
|
|
* expected from the server, failing which, an error is reported back
|
|
|
|
* to the user. */
|
|
|
|
IN int timeout);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpReadHttpGet gets specified number of bytes from a file
|
2006-06-06 10:51:22 +02:00
|
|
|
* specified in a URL.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b handle, \b buf
|
|
|
|
* or \b size is not a valid pointer.
|
|
|
|
* \li \c UPNP_E_BAD_RESPONSE: A bad response was received from the
|
2006-06-06 10:51:22 +02:00
|
|
|
* remote server.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_BAD_HTTPMSG: Either the request or response was in
|
2006-06-06 10:51:22 +02:00
|
|
|
* the incorrect format.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_CANCELED: another thread called UpnpCancelHttpGet.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
|
|
|
* Note: In case of return values, the status code parameter of the passed
|
|
|
|
* in handle value may provide additional information on the return
|
|
|
|
* value.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpReadHttpGet(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The token created by the call to \b UpnpOpenHttpGet. */
|
|
|
|
IN void *handle,
|
|
|
|
/*! The buffer to store the read item. */
|
|
|
|
IN OUT char *buf,
|
|
|
|
/*! The size of the buffer to be read. */
|
|
|
|
IN OUT unsigned int *size,
|
|
|
|
/*! The time out value sent with the request during which a response is
|
|
|
|
* expected from the server, failing which, an error is reported back to
|
|
|
|
* the user. */
|
|
|
|
IN int timeout);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief Retrieve progress information of a http-get transfer.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b handle, \b length
|
|
|
|
* or \b total is not a valid pointer.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpHttpGetProgress(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The token created by the call to \b UpnpOpenHttpGet. */
|
|
|
|
IN void *handle,
|
|
|
|
/*! The number of bytes received. */
|
|
|
|
OUT unsigned int *length,
|
|
|
|
/*! The content length. */
|
|
|
|
OUT unsigned int *total);
|
2006-06-06 10:51:22 +02:00
|
|
|
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief Set the cancel flag of the \b handle parameter.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_PARAM: \b handle is not a valid pointer.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpCancelHttpGet(IN void *handle);
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief Closes the connection and frees memory that was allocated for the
|
|
|
|
* \b handle parameter.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_PARAM: \b handle is not a valid pointer.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpCloseHttpGet(IN void *handle);
|
2006-06-06 10:51:22 +02:00
|
|
|
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \brief 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.
|
|
|
|
*
|
|
|
|
* The SDK allocates the memory for \b handle and \b contentType, the
|
|
|
|
* application is responsible for freeing this memory.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b url, \b handle
|
|
|
|
* or \b contentType is not a valid pointer.
|
|
|
|
* \li \c UPNP_E_INVALID_URL: The \b url is not a valid
|
2006-06-06 10:51:22 +02:00
|
|
|
* URL.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: Insufficient resources exist to
|
2006-06-06 10:51:22 +02:00
|
|
|
* download this file.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_ERROR: Error occured allocating a socket and
|
2006-06-06 10:51:22 +02:00
|
|
|
* resources or an error occurred binding a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_WRITE: An error or timeout occurred writing
|
2006-06-06 10:51:22 +02:00
|
|
|
* to a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_CONNECT: An error occurred connecting a
|
2006-06-06 10:51:22 +02:00
|
|
|
* socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_SOCKET: Too many sockets are currently
|
2006-06-06 10:51:22 +02:00
|
|
|
* allocated.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpOpenHttpPost(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The URL in which to send the POST request. */
|
|
|
|
IN const char *url,
|
|
|
|
/*! A pointer in which to store the handle for this connection. This
|
|
|
|
* handle is required for futher operations over this connection. */
|
|
|
|
IN OUT void **handle,
|
|
|
|
/*! A buffer to store the media type of content being sent. */
|
|
|
|
IN const char *contentType,
|
|
|
|
/*! The length of the content, in bytes, being posted. */
|
|
|
|
IN int contentLength,
|
|
|
|
/*! The time out value sent with the request during which a response
|
|
|
|
* is expected from the receiver, failing which, an error is reported. */
|
|
|
|
IN int timeout);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpWriteHttpPost sends a request to a server to copy the contents of
|
|
|
|
* a buffer to the URI specified in the \b UpnpOpenHttpPost call.
|
|
|
|
*
|
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b handle, \b buf
|
|
|
|
* or \b size is not a valid pointer.
|
|
|
|
* \li \c UPNP_E_SOCKET_WRITE: An error or timeout occurred writing
|
2006-06-06 10:51:22 +02:00
|
|
|
* to a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_SOCKET: Too many sockets are currently
|
2006-06-06 10:51:22 +02:00
|
|
|
* allocated.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpWriteHttpPost(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the connection created by the call to
|
|
|
|
* \b UpnpOpenHttpPost. */
|
|
|
|
IN void *handle,
|
|
|
|
/*! The buffer to be posted. */
|
|
|
|
IN char *buf,
|
|
|
|
/*! The size, in bytes of \b buf. */
|
|
|
|
IN unsigned int *size,
|
|
|
|
/*! A timeout value sent with the request during which a response is
|
|
|
|
* expected from the server, failing which, an error is reported. */
|
|
|
|
IN int timeout);
|
|
|
|
|
|
|
|
|
|
|
|
/*! \b UpnpCloseHttpPost sends and receives any pending data, closes the
|
2006-06-06 10:51:22 +02:00
|
|
|
* connection with the server, and frees memory allocated during the
|
2008-05-04 21:56:15 +02:00
|
|
|
* \b UpnpOpenHttpPost call.
|
|
|
|
*
|
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b handle, or
|
|
|
|
* \b httpStatus is not a valid pointer.
|
|
|
|
* \li \c UPNP_E_SOCKET_READ: An error or timeout occurred reading
|
2006-06-06 10:51:22 +02:00
|
|
|
* from a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_SOCKET: Too many sockets are currently
|
2006-06-06 10:51:22 +02:00
|
|
|
* allocated.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpCloseHttpPost(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the connection to close, created by the call to
|
|
|
|
* \b UpnpOpenHttpPost. */
|
|
|
|
IN void *handle,
|
|
|
|
/*! A pointer to a buffer to store the final status of the connection. */
|
|
|
|
IN OUT int *httpStatus,
|
|
|
|
/*! A time out value sent with the request during which a response is
|
|
|
|
* expected from the server, failing which, an error is reported. */
|
|
|
|
IN int timeout);
|
2006-06-06 10:51:22 +02:00
|
|
|
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \b UpnpDownloadXmlDoc downloads an XML document specified in a URL.
|
2006-06-06 10:51:22 +02:00
|
|
|
* The SDK parses the document and returns it in the form of a
|
|
|
|
* DOM document. The application is responsible for freeing the DOM document.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_PARAM: Either \b url or \b xmlDoc
|
2006-06-06 10:51:22 +02:00
|
|
|
* is not a valid pointer.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_DESC: The XML document was not
|
2006-06-06 10:51:22 +02:00
|
|
|
* found or it does not contain a valid XML description.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_INVALID_URL: The \b url is not a valid
|
2006-06-06 10:51:22 +02:00
|
|
|
* URL.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_MEMORY: There are insufficient resources to
|
2006-06-06 10:51:22 +02:00
|
|
|
* download the XML document.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_NETWORK_ERROR: A network error occurred.
|
|
|
|
* \li \c UPNP_E_SOCKET_WRITE: An error or timeout occurred writing
|
2006-06-06 10:51:22 +02:00
|
|
|
* to a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_READ: An error or timeout occurred reading
|
2006-06-06 10:51:22 +02:00
|
|
|
* from a socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_SOCKET_BIND: An error occurred binding a socket.
|
|
|
|
* \li \c UPNP_E_SOCKET_CONNECT: An error occurred connecting the
|
2006-06-06 10:51:22 +02:00
|
|
|
* socket.
|
2008-05-04 21:56:15 +02:00
|
|
|
* \li \c UPNP_E_OUTOF_SOCKET: Too many sockets are currently
|
2006-06-06 10:51:22 +02:00
|
|
|
* allocated.
|
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpDownloadXmlDoc(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! URL of the XML document. */
|
|
|
|
IN const char *url,
|
|
|
|
/*! A pointer in which to store the XML document. */
|
|
|
|
OUT IXML_Document **xmlDoc);
|
|
|
|
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2007-05-25 17:02:12 +02:00
|
|
|
/*! @} */ /* Control Point HTTP API */
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2007-05-25 17:02:12 +02:00
|
|
|
/******************************************************************************
|
|
|
|
******************************************************************************
|
|
|
|
* *
|
|
|
|
* W E B S E R V E R A P I *
|
|
|
|
* *
|
|
|
|
******************************************************************************
|
|
|
|
******************************************************************************/
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \name Web Server API */
|
2007-05-25 17:02:12 +02:00
|
|
|
/*! @{ */
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \b UpnpSetWebServerRootDir sets the document root directory for
|
2006-06-06 10:51:22 +02:00
|
|
|
* the internal web server. This directory is considered the
|
|
|
|
* root directory (i.e. "/") of the web server.
|
|
|
|
*
|
|
|
|
* This function also activates or deactivates the web server.
|
2008-05-04 21:56:15 +02:00
|
|
|
* To disable the web server, pass \c NULL for \b rootDir; to
|
2006-06-06 10:51:22 +02:00
|
|
|
* activate, pass a valid directory string.
|
|
|
|
*
|
|
|
|
* Note that this function is not available when the web server is not
|
|
|
|
* compiled into the SDK.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_ARGUMENT: \b rootDir is an invalid directory.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpSetWebServerRootDir(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Path of the root directory of the web server. */
|
2008-05-04 02:33:50 +02:00
|
|
|
IN const char *rootDir);
|
|
|
|
|
|
|
|
|
|
|
|
/* The type of handle returned by the web server for open requests. */
|
|
|
|
typedef void *UpnpWebFileHandle;
|
|
|
|
|
|
|
|
|
|
|
|
typedef int (*VDCallback_GetInfo)(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The name of the file to query. */
|
2008-05-04 02:33:50 +02:00
|
|
|
IN const char *filename,
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! Pointer to a structure to store the information on the file. */
|
2008-05-04 02:33:50 +02:00
|
|
|
OUT UpnpFileInfo *info);
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \b UpnpVirtualDir_set_GetInfoCallback sets the get_info callback function
|
2008-05-04 02:33:50 +02:00
|
|
|
* to be used to access a virtual directory.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_ARGUMENT: \b callback is not a valid pointer.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 02:33:50 +02:00
|
|
|
EXPORT_SPEC int UpnpVirtualDir_set_GetInfoCallback(VDCallback_GetInfo callback);
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 02:33:50 +02:00
|
|
|
typedef UpnpWebFileHandle (*VDCallback_Open)(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The name of the file to open. */
|
2008-05-04 02:33:50 +02:00
|
|
|
IN const char *filename,
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The mode in which to open the file.
|
|
|
|
* Valid values are \c UPNP_READ or \c UPNP_WRITE. */
|
2008-05-04 02:33:50 +02:00
|
|
|
IN enum UpnpOpenFileMode Mode);
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \b UpnpVirtualDir_set_OpenCallback sets the open callback function
|
2008-05-04 02:33:50 +02:00
|
|
|
* to be used to access a virtual directory.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_ARGUMENT: \b callback is not a valid pointer.
|
2008-05-04 02:33:50 +02:00
|
|
|
*/
|
|
|
|
EXPORT_SPEC int UpnpVirtualDir_set_OpenCallback(VDCallback_Open callback);
|
|
|
|
|
|
|
|
typedef int (*VDCallback_Read) (
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the file to read. */
|
2008-05-04 02:33:50 +02:00
|
|
|
IN UpnpWebFileHandle fileHnd,
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The buffer in which to place the data. */
|
2008-05-04 02:33:50 +02:00
|
|
|
OUT char *buf,
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The size of the buffer (i.e. the number of bytes to read). */
|
2008-05-04 02:33:50 +02:00
|
|
|
IN size_t buflen);
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \b UpnpVirtualDir_set_ReadCallback sets the read callback function
|
2008-05-04 02:33:50 +02:00
|
|
|
* to be used to access a virtual directory.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_ARGUMENT: \b callback is not a valid pointer.
|
2008-05-04 02:33:50 +02:00
|
|
|
*/
|
|
|
|
EXPORT_SPEC int UpnpVirtualDir_set_ReadCallback(VDCallback_Read callback);
|
|
|
|
|
|
|
|
typedef int (*VDCallback_Write) (
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the file to write. */
|
2008-05-04 02:33:50 +02:00
|
|
|
IN UpnpWebFileHandle fileHnd,
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The buffer with the bytes to write. */
|
2008-05-04 02:33:50 +02:00
|
|
|
IN char *buf,
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The number of bytes to write. */
|
2008-05-04 02:33:50 +02:00
|
|
|
IN size_t buflen);
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \b UpnpVirtualDir_set_WriteCallback sets the write callback function
|
2008-05-04 02:33:50 +02:00
|
|
|
* to be used to access a virtual directory.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_ARGUMENT: \b callback is not a valid pointer.
|
2008-05-04 02:33:50 +02:00
|
|
|
*/
|
|
|
|
EXPORT_SPEC int UpnpVirtualDir_set_WriteCallback(VDCallback_Write callback);
|
|
|
|
|
|
|
|
typedef int (*VDCallback_Seek) (
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the file to move the file pointer. */
|
2008-05-04 02:33:50 +02:00
|
|
|
IN UpnpWebFileHandle fileHnd,
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The number of bytes to move in the file. Positive values
|
2008-05-04 02:33:50 +02:00
|
|
|
* move foward and negative values move backward. Note that
|
2008-05-04 21:56:15 +02:00
|
|
|
* this must be positive if the \b origin is \c SEEK_SET. */
|
2008-05-04 02:33:50 +02:00
|
|
|
IN off_t offset,
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The position to move relative to. It can be \c SEEK_CUR
|
|
|
|
* to move relative to the current position, \c SEEK_END to
|
|
|
|
* move relative to the end of the file, or \c SEEK_SET to
|
2008-05-04 02:33:50 +02:00
|
|
|
* specify an absolute offset. */
|
|
|
|
IN int origin);
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \b UpnpVirtualDir_set_SeekCallback sets the seek callback function
|
2008-05-04 02:33:50 +02:00
|
|
|
* to be used to access a virtual directory.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_ARGUMENT: \b callback is not a valid pointer.
|
2008-05-04 02:33:50 +02:00
|
|
|
*/
|
|
|
|
EXPORT_SPEC int UpnpVirtualDir_set_SeekCallback(VDCallback_Seek callback);
|
|
|
|
|
|
|
|
typedef int (*VDCallback_Close) (
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The handle of the file to close. */
|
2008-05-04 02:33:50 +02:00
|
|
|
IN UpnpWebFileHandle fileHnd);
|
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \b UpnpVirtualDir_set_CloseCallback sets the close callback function
|
2008-05-04 02:33:50 +02:00
|
|
|
* to be used to access a virtual directory.
|
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_ARGUMENT: \b callback is not a valid pointer.
|
2008-05-04 02:33:50 +02:00
|
|
|
*/
|
|
|
|
EXPORT_SPEC int UpnpVirtualDir_set_CloseCallback(VDCallback_Close callback);
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \b UpnpEnableWebServer enables or disables the webserver. A value of
|
|
|
|
* \c TRUE enables the webserver, \c FALSE disables it.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_ARGUMENT: \b enable is not valid.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpEnableWebserver(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \c TRUE to enable, \c FALSE to disable. */
|
2008-05-04 02:33:50 +02:00
|
|
|
IN int enable);
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \b UpnpIsWebServerEnabled returns \c TRUE if the webserver is
|
|
|
|
* enabled, or \c FALSE if it is not.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c TRUE: The webserver is enabled.
|
|
|
|
* \li \c FALSE: The webserver is not enabled
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpIsWebserverEnabled();
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \b UpnpAddVirtualDir adds a virtual directory mapping.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
|
|
|
* All webserver requests containing the given directory are read using
|
2008-05-04 21:56:15 +02:00
|
|
|
* functions contained in a \b VirtualDirCallbacks structure registered
|
|
|
|
* via \b UpnpSetVirtualDirCallbacks.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_ARGUMENT: \b dirName is not valid.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpAddVirtualDir(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The name of the new directory mapping to add. */
|
2008-05-04 02:33:50 +02:00
|
|
|
IN const char *dirName);
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \b UpnpRemoveVirtualDir removes a virtual directory mapping made with
|
|
|
|
* \b UpnpAddVirtualDir.
|
2006-06-06 10:51:22 +02:00
|
|
|
*
|
2008-05-04 21:56:15 +02:00
|
|
|
* \return [int] An integer representing one of the following:
|
|
|
|
* \li \c UPNP_E_SUCCESS: The operation completed successfully.
|
|
|
|
* \li \c UPNP_E_INVALID_ARGUMENT: \b dirName is not valid.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC int UpnpRemoveVirtualDir(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The name of the virtual directory mapping to remove. */
|
2008-05-04 02:33:50 +02:00
|
|
|
IN const char *dirName);
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! \b UpnpRemoveAllVirtualDirs removes all virtual directory mappings.
|
2006-06-06 10:51:22 +02:00
|
|
|
*/
|
2008-05-04 02:33:50 +02:00
|
|
|
EXPORT_SPEC void UpnpRemoveAllVirtualDirs();
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2006-06-13 14:34:29 +02:00
|
|
|
EXPORT_SPEC void UpnpFree(
|
2008-05-04 21:56:15 +02:00
|
|
|
/*! The item to free. */
|
2008-05-04 02:33:50 +02:00
|
|
|
IN void *item);
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2007-05-25 17:02:12 +02:00
|
|
|
/*! @} */ /* Web Server API */
|
2006-06-06 10:51:22 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
2007-05-25 17:02:12 +02:00
|
|
|
#endif /* __cplusplus */
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 21:56:15 +02:00
|
|
|
/*@}*/ /* TheAPI */
|
2006-06-06 10:51:22 +02:00
|
|
|
|
2008-05-04 02:57:07 +02:00
|
|
|
#endif /* UPNP_H */
|
2007-05-16 04:02:16 +02:00
|
|
|
|