|
@@ -1,21 +1,41 @@
|
|
|
-/* $Id: upnpcommands.h,v 1.32 2018/03/13 23:34:47 nanard Exp $ */
|
|
|
-/* Miniupnp project : http://miniupnp.free.fr/
|
|
|
- * Author : Thomas Bernard
|
|
|
- * Copyright (c) 2005-2018 Thomas Bernard
|
|
|
+/* $Id: upnpcommands.h,v 1.36 2025/03/18 23:40:15 nanard Exp $ */
|
|
|
+/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
|
|
+ * Project: miniupnp
|
|
|
+ * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
|
|
|
+ * Author: Thomas Bernard
|
|
|
+ * Copyright (c) 2005-2025 Thomas Bernard
|
|
|
* This software is subject to the conditions detailed in the
|
|
|
* LICENCE file provided within this distribution */
|
|
|
#ifndef UPNPCOMMANDS_H_INCLUDED
|
|
|
#define UPNPCOMMANDS_H_INCLUDED
|
|
|
|
|
|
+/*! \file upnpcommands.h
|
|
|
+ * \brief Internet Gateway Device methods
|
|
|
+ *
|
|
|
+ * See the documentation for both IGD v1 and IGD v2 :
|
|
|
+ * - https://upnp.org/specs/gw/UPnP-gw-InternetGatewayDevice-v1-Device.pdf
|
|
|
+ * - https://upnp.org/specs/gw/UPnP-gw-InternetGatewayDevice-v2-Device.pdf
|
|
|
+ *
|
|
|
+ * The methods are from WANIPConnection:1 or 2, WANCommonInterfaceConfig:1,
|
|
|
+ * and WANIPv6FirewallControl:1
|
|
|
+ *
|
|
|
+ */
|
|
|
+
|
|
|
#include "miniupnpc_declspec.h"
|
|
|
#include "miniupnpctypes.h"
|
|
|
|
|
|
/* MiniUPnPc return codes : */
|
|
|
+/*! \brief value for success */
|
|
|
#define UPNPCOMMAND_SUCCESS (0)
|
|
|
+/*! \brief value for unknown error */
|
|
|
#define UPNPCOMMAND_UNKNOWN_ERROR (-1)
|
|
|
+/*! \brief error while checking the arguments */
|
|
|
#define UPNPCOMMAND_INVALID_ARGS (-2)
|
|
|
+/*! \brief HTTP communication error */
|
|
|
#define UPNPCOMMAND_HTTP_ERROR (-3)
|
|
|
+/*! \brief The response contains invalid values */
|
|
|
#define UPNPCOMMAND_INVALID_RESPONSE (-4)
|
|
|
+/*! \brief Memory allocation error */
|
|
|
#define UPNPCOMMAND_MEM_ALLOC_ERROR (-5)
|
|
|
|
|
|
#ifdef __cplusplus
|
|
@@ -24,27 +44,70 @@ extern "C" {
|
|
|
|
|
|
struct PortMappingParserData;
|
|
|
|
|
|
+/*! \brief WANCommonInterfaceConfig:GetTotalBytesSent
|
|
|
+ *
|
|
|
+ * Note: this is a 32bits unsigned value and rolls over to 0 after reaching
|
|
|
+ * the maximum value
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANCommonInterfaceConfig of
|
|
|
+ * a WANDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1
|
|
|
+ */
|
|
|
MINIUPNP_LIBSPEC UNSIGNED_INTEGER
|
|
|
UPNP_GetTotalBytesSent(const char * controlURL,
|
|
|
const char * servicetype);
|
|
|
|
|
|
+/*! \brief WANCommonInterfaceConfig:GetTotalBytesReceived
|
|
|
+ *
|
|
|
+ * Note: this is a 32bits unsigned value and rolls over to 0 after reaching
|
|
|
+ * the maximum value
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANCommonInterfaceConfig of a WANDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1
|
|
|
+ */
|
|
|
MINIUPNP_LIBSPEC UNSIGNED_INTEGER
|
|
|
UPNP_GetTotalBytesReceived(const char * controlURL,
|
|
|
const char * servicetype);
|
|
|
|
|
|
+/*! \brief WANCommonInterfaceConfig:GetTotalPacketsSent
|
|
|
+ *
|
|
|
+ * Note: this is a 32bits unsigned value and rolls over to 0 after reaching
|
|
|
+ * the maximum value
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANCommonInterfaceConfig of a WANDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1
|
|
|
+ */
|
|
|
MINIUPNP_LIBSPEC UNSIGNED_INTEGER
|
|
|
UPNP_GetTotalPacketsSent(const char * controlURL,
|
|
|
const char * servicetype);
|
|
|
|
|
|
+/*! \brief WANCommonInterfaceConfig:GetTotalBytesReceived
|
|
|
+ *
|
|
|
+ * Note: this is a 32bits unsigned value and rolls over to 0 after reaching
|
|
|
+ * the maximum value
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANCommonInterfaceConfig of a WANDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1
|
|
|
+ */
|
|
|
MINIUPNP_LIBSPEC UNSIGNED_INTEGER
|
|
|
UPNP_GetTotalPacketsReceived(const char * controlURL,
|
|
|
const char * servicetype);
|
|
|
|
|
|
-/* UPNP_GetStatusInfo()
|
|
|
- * status and lastconnerror are 64 byte buffers
|
|
|
- * Return values :
|
|
|
- * UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR
|
|
|
- * or a UPnP Error code */
|
|
|
+/*! \brief WANIPConnection:GetStatusInfo()
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANIPConnection of a WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPConnection:1
|
|
|
+ * \param[out] status 64 bytes buffer : `Unconfigured`, `Connecting`,
|
|
|
+ * `Connected`, `PendingDisconnect`, `Disconnecting`, `Disconnected`
|
|
|
+ * \param[out] uptime time in seconds
|
|
|
+ * \param[out] lastconnerror 64 bytes buffer : `ERROR_NONE`,
|
|
|
+ * `ERROR_COMMAND_ABORTED`, `ERROR_NOT_ENABLED_FOR_INTERNET`,
|
|
|
+ * `ERROR_USER_DISCONNECT`, `ERROR_ISP_DISCONNECT`,
|
|
|
+ * `ERROR_IDLE_DISCONNECT`, `ERROR_FORCED_DISCONNECT`,
|
|
|
+ * `ERROR_NO_CARRIER`, `ERROR_IP_CONFIGURATION`, `ERROR_UNKNOWN`
|
|
|
+ * \return #UPNPCOMMAND_SUCCESS, #UPNPCOMMAND_INVALID_ARGS,
|
|
|
+ * #UPNPCOMMAND_UNKNOWN_ERROR or a UPnP Error code
|
|
|
+ */
|
|
|
MINIUPNP_LIBSPEC int
|
|
|
UPNP_GetStatusInfo(const char * controlURL,
|
|
|
const char * servicetype,
|
|
@@ -52,76 +115,87 @@ UPNP_GetStatusInfo(const char * controlURL,
|
|
|
unsigned int * uptime,
|
|
|
char * lastconnerror);
|
|
|
|
|
|
-/* UPNP_GetConnectionTypeInfo()
|
|
|
- * argument connectionType is a 64 character buffer
|
|
|
- * Return Values :
|
|
|
- * UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR
|
|
|
- * or a UPnP Error code */
|
|
|
+/*! \brief WANIPConnection:GetConnectionTypeInfo()
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANIPConnection of a WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPConnection:1
|
|
|
+ * \param[out] connectionType 64 characters buffer : `Unconfigured`,
|
|
|
+ * `IP_Routed`, `IP_Bridged`
|
|
|
+ * \return #UPNPCOMMAND_SUCCESS, #UPNPCOMMAND_INVALID_ARGS,
|
|
|
+ * #UPNPCOMMAND_UNKNOWN_ERROR or a UPnP Error code
|
|
|
+ */
|
|
|
MINIUPNP_LIBSPEC int
|
|
|
UPNP_GetConnectionTypeInfo(const char * controlURL,
|
|
|
const char * servicetype,
|
|
|
char * connectionType);
|
|
|
|
|
|
-/* UPNP_GetExternalIPAddress() call the corresponding UPNP method.
|
|
|
- * if the third arg is not null the value is copied to it.
|
|
|
- * at least 16 bytes must be available
|
|
|
- *
|
|
|
- * Return values :
|
|
|
- * 0 : SUCCESS
|
|
|
- * NON ZERO : ERROR Either an UPnP error code or an unknown error.
|
|
|
+/*! \brief WANIPConnection:GetExternalIPAddress()
|
|
|
*
|
|
|
* possible UPnP Errors :
|
|
|
- * 402 Invalid Args - See UPnP Device Architecture section on Control.
|
|
|
- * 501 Action Failed - See UPnP Device Architecture section on Control. */
|
|
|
+ * - 402 Invalid Args - See UPnP Device Architecture section on Control.
|
|
|
+ * - 501 Action Failed - See UPnP Device Architecture section on Control.
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANIPConnection of a WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPConnection:1
|
|
|
+ * \param[out] extIpAdd 16 bytes buffer
|
|
|
+ * \return #UPNPCOMMAND_SUCCESS, #UPNPCOMMAND_UNKNOWN_ERROR,
|
|
|
+ * #UPNPCOMMAND_INVALID_ARGS, #UPNPCOMMAND_HTTP_ERROR or an
|
|
|
+ * UPnP error code
|
|
|
+ */
|
|
|
MINIUPNP_LIBSPEC int
|
|
|
UPNP_GetExternalIPAddress(const char * controlURL,
|
|
|
const char * servicetype,
|
|
|
char * extIpAdd);
|
|
|
|
|
|
-/* UPNP_GetLinkLayerMaxBitRates()
|
|
|
- * call WANCommonInterfaceConfig:1#GetCommonLinkProperties
|
|
|
+/*! \brief UPNP_GetLinkLayerMaxBitRates()
|
|
|
+ * call `WANCommonInterfaceConfig:GetCommonLinkProperties`
|
|
|
*
|
|
|
- * return values :
|
|
|
- * UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR
|
|
|
- * or a UPnP Error Code. */
|
|
|
+ * \param[in] controlURL controlURL of the WANCommonInterfaceConfig of a WANDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1
|
|
|
+ * \param[out] bitrateDown bits per second
|
|
|
+ * \param[out] bitrateUp bits per second
|
|
|
+ * \return #UPNPCOMMAND_SUCCESS, #UPNPCOMMAND_INVALID_ARGS,
|
|
|
+ * #UPNPCOMMAND_UNKNOWN_ERROR or a UPnP Error Code.
|
|
|
+ */
|
|
|
MINIUPNP_LIBSPEC int
|
|
|
UPNP_GetLinkLayerMaxBitRates(const char* controlURL,
|
|
|
const char* servicetype,
|
|
|
unsigned int * bitrateDown,
|
|
|
unsigned int * bitrateUp);
|
|
|
|
|
|
-/* UPNP_AddPortMapping()
|
|
|
- * if desc is NULL, it will be defaulted to "libminiupnpc"
|
|
|
- * remoteHost is usually NULL because IGD don't support it.
|
|
|
- *
|
|
|
- * Return values :
|
|
|
- * 0 : SUCCESS
|
|
|
- * NON ZERO : ERROR. Either an UPnP error code or an unknown error.
|
|
|
+/*! \brief WANIPConnection:AddPortMapping()
|
|
|
*
|
|
|
* List of possible UPnP errors for AddPortMapping :
|
|
|
- * errorCode errorDescription (short) - Description (long)
|
|
|
- * 402 Invalid Args - See UPnP Device Architecture section on Control.
|
|
|
- * 501 Action Failed - See UPnP Device Architecture section on Control.
|
|
|
- * 606 Action not authorized - The action requested REQUIRES authorization and
|
|
|
- * the sender was not authorized.
|
|
|
- * 715 WildCardNotPermittedInSrcIP - The source IP address cannot be
|
|
|
- * wild-carded
|
|
|
- * 716 WildCardNotPermittedInExtPort - The external port cannot be wild-carded
|
|
|
- * 718 ConflictInMappingEntry - The port mapping entry specified conflicts
|
|
|
- * with a mapping assigned previously to another client
|
|
|
- * 724 SamePortValuesRequired - Internal and External port values
|
|
|
- * must be the same
|
|
|
- * 725 OnlyPermanentLeasesSupported - The NAT implementation only supports
|
|
|
- * permanent lease times on port mappings
|
|
|
- * 726 RemoteHostOnlySupportsWildcard - RemoteHost must be a wildcard
|
|
|
- * and cannot be a specific IP address or DNS name
|
|
|
- * 727 ExternalPortOnlySupportsWildcard - ExternalPort must be a wildcard and
|
|
|
- * cannot be a specific port value
|
|
|
- * 728 NoPortMapsAvailable - There are not enough free ports available to
|
|
|
- * complete port mapping.
|
|
|
- * 729 ConflictWithOtherMechanisms - Attempted port mapping is not allowed
|
|
|
- * due to conflict with other mechanisms.
|
|
|
- * 732 WildCardNotPermittedInIntPort - The internal port cannot be wild-carded
|
|
|
+ * errorCode errorDescription (short) | Description (long)
|
|
|
+ * ---------------------------------- | -----------------
|
|
|
+ * 402 Invalid Args | See UPnP Device Architecture section on Control.
|
|
|
+ * 501 Action Failed | See UPnP Device Architecture section on Control.
|
|
|
+ * 606 Action not authorized | The action requested REQUIRES authorization and the sender was not authorized.
|
|
|
+ * 715 WildCardNotPermittedInSrcIP | The source IP address cannot be wild-carded
|
|
|
+ * 716 WildCardNotPermittedInExtPort | The external port cannot be wild-carded
|
|
|
+ * 718 ConflictInMappingEntry | The port mapping entry specified conflicts with a mapping assigned previously to another client
|
|
|
+ * 724 SamePortValuesRequired | Internal and External port values must be the same
|
|
|
+ * 725 OnlyPermanentLeasesSupported | The NAT implementation only supports permanent lease times on port mappings
|
|
|
+ * 726 RemoteHostOnlySupportsWildcard | RemoteHost must be a wildcard and cannot be a specific IP address or DNS name
|
|
|
+ * 727 ExternalPortOnlySupportsWildcard | ExternalPort must be a wildcard and cannot be a specific port value
|
|
|
+ * 728 NoPortMapsAvailable | There are not enough free ports available to complete port mapping.
|
|
|
+ * 729 ConflictWithOtherMechanisms | Attempted port mapping is not allowed due to conflict with other mechanisms.
|
|
|
+ * 732 WildCardNotPermittedInIntPort | The internal port cannot be wild-carded
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANIPConnection of a WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPConnection:1
|
|
|
+ * \param[in] extPort External port
|
|
|
+ * \param[in] inPort Internal port
|
|
|
+ * \param[in] inClient IP of Internal client.
|
|
|
+ * \param[in] desc Port Mapping description. if NULL, defaults to
|
|
|
+ * "libminiupnpc"
|
|
|
+ * \param[in] proto `TCP` or `UDP`
|
|
|
+ * \param[in] remoteHost IP or empty string for wildcard. Most IGD don't
|
|
|
+ * support it
|
|
|
+ * \param[in] leaseDuration between 0 and 604800
|
|
|
+ * \return #UPNPCOMMAND_SUCCESS, #UPNPCOMMAND_INVALID_ARGS,
|
|
|
+ * #UPNPCOMMAND_MEM_ALLOC_ERROR, #UPNPCOMMAND_HTTP_ERROR,
|
|
|
+ * #UPNPCOMMAND_UNKNOWN_ERROR or a UPnP error code.
|
|
|
*/
|
|
|
MINIUPNP_LIBSPEC int
|
|
|
UPNP_AddPortMapping(const char * controlURL, const char * servicetype,
|
|
@@ -133,28 +207,38 @@ UPNP_AddPortMapping(const char * controlURL, const char * servicetype,
|
|
|
const char * remoteHost,
|
|
|
const char * leaseDuration);
|
|
|
|
|
|
-/* UPNP_AddAnyPortMapping()
|
|
|
- * if desc is NULL, it will be defaulted to "libminiupnpc"
|
|
|
- * remoteHost is usually NULL because IGD don't support it.
|
|
|
+/*! \brief WANIPConnection:AddAnyPortMapping()
|
|
|
*
|
|
|
- * Return values :
|
|
|
- * 0 : SUCCESS
|
|
|
- * NON ZERO : ERROR. Either an UPnP error code or an unknown error.
|
|
|
+ * Only in WANIPConnection:2
|
|
|
*
|
|
|
* List of possible UPnP errors for AddPortMapping :
|
|
|
- * errorCode errorDescription (short) - Description (long)
|
|
|
- * 402 Invalid Args - See UPnP Device Architecture section on Control.
|
|
|
- * 501 Action Failed - See UPnP Device Architecture section on Control.
|
|
|
- * 606 Action not authorized - The action requested REQUIRES authorization and
|
|
|
- * the sender was not authorized.
|
|
|
- * 715 WildCardNotPermittedInSrcIP - The source IP address cannot be
|
|
|
- * wild-carded
|
|
|
- * 716 WildCardNotPermittedInExtPort - The external port cannot be wild-carded
|
|
|
- * 728 NoPortMapsAvailable - There are not enough free ports available to
|
|
|
- * complete port mapping.
|
|
|
- * 729 ConflictWithOtherMechanisms - Attempted port mapping is not allowed
|
|
|
- * due to conflict with other mechanisms.
|
|
|
- * 732 WildCardNotPermittedInIntPort - The internal port cannot be wild-carded
|
|
|
+ * errorCode errorDescription (short) | Description (long)
|
|
|
+ * ---------------------------------- | ------------------
|
|
|
+ * 402 Invalid Args | See UPnP Device Architecture section on Control.
|
|
|
+ * 501 Action Failed | See UPnP Device Architecture section on Control.
|
|
|
+ * 606 Action not authorized | The action requested REQUIRES authorization and the sender was not authorized.
|
|
|
+ * 715 WildCardNotPermittedInSrcIP | The source IP address cannot be wild-carded
|
|
|
+ * 716 WildCardNotPermittedInExtPort | The external port cannot be wild-carded
|
|
|
+ * 728 NoPortMapsAvailable | There are not enough free ports available to complete port mapping.
|
|
|
+ * 729 ConflictWithOtherMechanisms | Attempted port mapping is not allowed due to conflict with other mechanisms.
|
|
|
+ * 732 WildCardNotPermittedInIntPort | The internal port cannot be wild-carded
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANIPConnection of a WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPConnection:2
|
|
|
+ * \param[in] extPort External port
|
|
|
+ * \param[in] inPort Internal port
|
|
|
+ * \param[in] inClient IP of Internal client.
|
|
|
+ * \param[in] desc Port Mapping description. if NULL, defaults to
|
|
|
+ * "libminiupnpc"
|
|
|
+ * \param[in] proto `TCP` or `UDP`
|
|
|
+ * \param[in] remoteHost IP or empty string for wildcard. Most IGD don't
|
|
|
+ * support it
|
|
|
+ * \param[in] leaseDuration between 0 and 604800
|
|
|
+ * \param[out] reservedPort 6 bytes buffer
|
|
|
+ * \return #UPNPCOMMAND_SUCCESS, #UPNPCOMMAND_INVALID_ARGS,
|
|
|
+ * #UPNPCOMMAND_MEM_ALLOC_ERROR, #UPNPCOMMAND_HTTP_ERROR,
|
|
|
+ * #UPNPCOMMAND_INVALID_RESPONSE, #UPNPCOMMAND_UNKNOWN_ERROR
|
|
|
+ * or a UPnP error code.
|
|
|
*/
|
|
|
MINIUPNP_LIBSPEC int
|
|
|
UPNP_AddAnyPortMapping(const char * controlURL, const char * servicetype,
|
|
@@ -167,24 +251,35 @@ UPNP_AddAnyPortMapping(const char * controlURL, const char * servicetype,
|
|
|
const char * leaseDuration,
|
|
|
char * reservedPort);
|
|
|
|
|
|
-/* UPNP_DeletePortMapping()
|
|
|
- * Use same argument values as what was used for AddPortMapping().
|
|
|
- * remoteHost is usually NULL because IGD don't support it.
|
|
|
- * Return Values :
|
|
|
- * 0 : SUCCESS
|
|
|
- * NON ZERO : error. Either an UPnP error code or an undefined error.
|
|
|
+/*! \brief WANIPConnection:DeletePortMapping()
|
|
|
*
|
|
|
- * List of possible UPnP errors for DeletePortMapping :
|
|
|
- * 402 Invalid Args - See UPnP Device Architecture section on Control.
|
|
|
- * 606 Action not authorized - The action requested REQUIRES authorization
|
|
|
- * and the sender was not authorized.
|
|
|
- * 714 NoSuchEntryInArray - The specified value does not exist in the array */
|
|
|
+ * Use same argument values as what was used for UPNP_AddPortMapping()
|
|
|
+ *
|
|
|
+ * List of possible UPnP errors for UPNP_DeletePortMapping() :
|
|
|
+ * errorCode errorDescription (short) | Description (long)
|
|
|
+ * ---------------------------------- | ------------------
|
|
|
+ * 402 Invalid Args | See UPnP Device Architecture section on Control.
|
|
|
+ * 606 Action not authorized | The action requested REQUIRES authorization and the sender was not authorized.
|
|
|
+ * 714 NoSuchEntryInArray | The specified value does not exist in the array
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANIPConnection of a WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPConnection:1
|
|
|
+ * \param[in] extPort External port
|
|
|
+ * \param[in] proto `TCP` or `UDP`
|
|
|
+ * \param[in] remoteHost IP or empty string for wildcard. Most IGD don't
|
|
|
+ * support it
|
|
|
+ * \return #UPNPCOMMAND_SUCCESS, #UPNPCOMMAND_INVALID_ARGS,
|
|
|
+ * #UPNPCOMMAND_MEM_ALLOC_ERROR, #UPNPCOMMAND_HTTP_ERROR,
|
|
|
+ * #UPNPCOMMAND_UNKNOWN_ERROR or a UPnP error code.
|
|
|
+ */
|
|
|
MINIUPNP_LIBSPEC int
|
|
|
UPNP_DeletePortMapping(const char * controlURL, const char * servicetype,
|
|
|
const char * extPort, const char * proto,
|
|
|
const char * remoteHost);
|
|
|
|
|
|
-/* UPNP_DeletePortRangeMapping()
|
|
|
+/*! \brief WANIPConnection:DeletePortRangeMapping()
|
|
|
+ *
|
|
|
+ * Only in WANIPConnection:2
|
|
|
* Use same argument values as what was used for AddPortMapping().
|
|
|
* remoteHost is usually NULL because IGD don't support it.
|
|
|
* Return Values :
|
|
@@ -192,46 +287,66 @@ UPNP_DeletePortMapping(const char * controlURL, const char * servicetype,
|
|
|
* NON ZERO : error. Either an UPnP error code or an undefined error.
|
|
|
*
|
|
|
* List of possible UPnP errors for DeletePortMapping :
|
|
|
- * 606 Action not authorized - The action requested REQUIRES authorization
|
|
|
- * and the sender was not authorized.
|
|
|
- * 730 PortMappingNotFound - This error message is returned if no port
|
|
|
- * mapping is found in the specified range.
|
|
|
- * 733 InconsistentParameters - NewStartPort and NewEndPort values are not consistent. */
|
|
|
+ * errorCode errorDescription (short) | Description (long)
|
|
|
+ * ---------------------------------- | ------------------
|
|
|
+ * 606 Action not authorized | The action requested REQUIRES authorization and the sender was not authorized.
|
|
|
+ * 730 PortMappingNotFound | This error message is returned if no port mapping is found in the specified range.
|
|
|
+ * 733 InconsistentParameters | NewStartPort and NewEndPort values are not consistent.
|
|
|
+ * \param[in] controlURL controlURL of the WANIPConnection of a WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPConnection:2
|
|
|
+ * \param[in] extPortStart External port range start
|
|
|
+ * \param[in] extPortEnd External port range end
|
|
|
+ * \param[in] proto `TCP` or `UDP`
|
|
|
+ * \param[in] manage `0` to remove only the port mappings of this IGD,
|
|
|
+ * `1` to remove port mappings also for other clients
|
|
|
+ * \return #UPNPCOMMAND_SUCCESS, #UPNPCOMMAND_INVALID_ARGS,
|
|
|
+ * #UPNPCOMMAND_MEM_ALLOC_ERROR, #UPNPCOMMAND_HTTP_ERROR,
|
|
|
+ * #UPNPCOMMAND_UNKNOWN_ERROR or a UPnP error code.
|
|
|
+ */
|
|
|
MINIUPNP_LIBSPEC int
|
|
|
UPNP_DeletePortMappingRange(const char * controlURL, const char * servicetype,
|
|
|
const char * extPortStart, const char * extPortEnd,
|
|
|
const char * proto,
|
|
|
const char * manage);
|
|
|
|
|
|
-/* UPNP_GetPortMappingNumberOfEntries()
|
|
|
- * not supported by all routers */
|
|
|
+/*! \brief WANIPConnection:GetPortMappingNumberOfEntries()
|
|
|
+ *
|
|
|
+ * not supported by all routers
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANIPConnection of a WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPConnection:1
|
|
|
+ * \param[out] numEntries Port mappings count
|
|
|
+ * \return #UPNPCOMMAND_SUCCESS, #UPNPCOMMAND_HTTP_ERROR,
|
|
|
+ * #UPNPCOMMAND_UNKNOWN_ERROR or a UPnP error code.
|
|
|
+ */
|
|
|
MINIUPNP_LIBSPEC int
|
|
|
UPNP_GetPortMappingNumberOfEntries(const char * controlURL,
|
|
|
const char * servicetype,
|
|
|
unsigned int * numEntries);
|
|
|
|
|
|
-/* UPNP_GetSpecificPortMappingEntry()
|
|
|
- * retrieves an existing port mapping
|
|
|
- * params :
|
|
|
- * in extPort
|
|
|
- * in proto
|
|
|
- * in remoteHost
|
|
|
- * out intClient (16 bytes)
|
|
|
- * out intPort (6 bytes)
|
|
|
- * out desc (80 bytes)
|
|
|
- * out enabled (4 bytes)
|
|
|
- * out leaseDuration (16 bytes)
|
|
|
- *
|
|
|
- * return value :
|
|
|
- * UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR
|
|
|
- * or a UPnP Error Code.
|
|
|
- *
|
|
|
- * List of possible UPnP errors for _GetSpecificPortMappingEntry :
|
|
|
- * 402 Invalid Args - See UPnP Device Architecture section on Control.
|
|
|
- * 501 Action Failed - See UPnP Device Architecture section on Control.
|
|
|
- * 606 Action not authorized - The action requested REQUIRES authorization
|
|
|
- * and the sender was not authorized.
|
|
|
- * 714 NoSuchEntryInArray - The specified value does not exist in the array.
|
|
|
+/*! \brief retrieves an existing port mapping for a port:protocol
|
|
|
+ *
|
|
|
+ * List of possible UPnP errors for UPNP_GetSpecificPortMappingEntry() :
|
|
|
+ * errorCode errorDescription (short) | Description (long)
|
|
|
+ * ---------------------------------- | ------------------
|
|
|
+ * 402 Invalid Args | See UPnP Device Architecture section on Control.
|
|
|
+ * 501 Action Failed | See UPnP Device Architecture section on Control.
|
|
|
+ * 606 Action not authorized | The action requested REQUIRES authorization and the sender was not authorized.
|
|
|
+ * 714 NoSuchEntryInArray | The specified value does not exist in the array.
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANIPConnection of a WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPConnection:1
|
|
|
+ * \param[in] extPort External port
|
|
|
+ * \param[in] proto `TCP` or `UDP`
|
|
|
+ * \param[in] remoteHost IP or empty string for wildcard. Most IGD don't
|
|
|
+ * support it
|
|
|
+ * \param[out] intClient 16 bytes buffer
|
|
|
+ * \param[out] intPort 6 bytes buffer
|
|
|
+ * \param[out] desc 80 bytes buffer
|
|
|
+ * \param[out] enabled 4 bytes buffer
|
|
|
+ * \param[out] leaseDuration 16 bytes
|
|
|
+ * \return #UPNPCOMMAND_SUCCESS, #UPNPCOMMAND_INVALID_ARGS,
|
|
|
+ * #UPNPCOMMAND_UNKNOWN_ERROR or a UPnP Error Code.
|
|
|
*/
|
|
|
MINIUPNP_LIBSPEC int
|
|
|
UPNP_GetSpecificPortMappingEntry(const char * controlURL,
|
|
@@ -245,27 +360,65 @@ UPNP_GetSpecificPortMappingEntry(const char * controlURL,
|
|
|
char * enabled,
|
|
|
char * leaseDuration);
|
|
|
|
|
|
-/* UPNP_GetGenericPortMappingEntry()
|
|
|
- * params :
|
|
|
- * in index
|
|
|
- * out extPort (6 bytes)
|
|
|
- * out intClient (16 bytes)
|
|
|
- * out intPort (6 bytes)
|
|
|
- * out protocol (4 bytes)
|
|
|
- * out desc (80 bytes)
|
|
|
- * out enabled (4 bytes)
|
|
|
- * out rHost (64 bytes)
|
|
|
- * out duration (16 bytes)
|
|
|
- *
|
|
|
- * return value :
|
|
|
- * UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR
|
|
|
- * or a UPnP Error Code.
|
|
|
- *
|
|
|
- * Possible UPNP Error codes :
|
|
|
- * 402 Invalid Args - See UPnP Device Architecture section on Control.
|
|
|
- * 606 Action not authorized - The action requested REQUIRES authorization
|
|
|
- * and the sender was not authorized.
|
|
|
- * 713 SpecifiedArrayIndexInvalid - The specified array index is out of bounds
|
|
|
+/*! \brief retrieves an existing port mapping for a port:protocol
|
|
|
+ *
|
|
|
+ * List of possible UPnP errors for UPNP_GetSpecificPortMappingEntry() :
|
|
|
+ * errorCode errorDescription (short) | Description (long)
|
|
|
+ * ---------------------------------- | ------------------
|
|
|
+ * 402 Invalid Args | See UPnP Device Architecture section on Control.
|
|
|
+ * 501 Action Failed | See UPnP Device Architecture section on Control.
|
|
|
+ * 606 Action not authorized | The action requested REQUIRES authorization and the sender was not authorized.
|
|
|
+ * 714 NoSuchEntryInArray | The specified value does not exist in the array.
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANIPConnection of a WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPConnection:1
|
|
|
+ * \param[in] extPort External port
|
|
|
+ * \param[in] proto `TCP` or `UDP`
|
|
|
+ * \param[in] remoteHost IP or empty string for wildcard. Most IGD don't
|
|
|
+ * support it
|
|
|
+ * \param[out] intClient 16 bytes buffer
|
|
|
+ * \param[out] intPort 6 bytes buffer
|
|
|
+ * \param[out] desc desclen bytes buffer
|
|
|
+ * \param[in] desclen desc buffer length
|
|
|
+ * \param[out] enabled 4 bytes buffer
|
|
|
+ * \param[out] leaseDuration 16 bytes
|
|
|
+ * \return #UPNPCOMMAND_SUCCESS, #UPNPCOMMAND_INVALID_ARGS,
|
|
|
+ * #UPNPCOMMAND_UNKNOWN_ERROR or a UPnP Error Code.
|
|
|
+ */
|
|
|
+MINIUPNP_LIBSPEC int
|
|
|
+UPNP_GetSpecificPortMappingEntryExt(const char * controlURL,
|
|
|
+ const char * servicetype,
|
|
|
+ const char * extPort,
|
|
|
+ const char * proto,
|
|
|
+ const char * remoteHost,
|
|
|
+ char * intClient,
|
|
|
+ char * intPort,
|
|
|
+ char * desc,
|
|
|
+ size_t desclen,
|
|
|
+ char * enabled,
|
|
|
+ char * leaseDuration);
|
|
|
+
|
|
|
+/*! \brief WANIPConnection:GetGenericPortMappingEntry()
|
|
|
+ *
|
|
|
+ * errorCode errorDescription (short) | Description (long)
|
|
|
+ * ---------------------------------- | ------------------
|
|
|
+ * 402 Invalid Args | See UPnP Device Architecture section on Control.
|
|
|
+ * 606 Action not authorized | The action requested REQUIRES authorization and the sender was not authorized.
|
|
|
+ * 713 SpecifiedArrayIndexInvalid | The specified array index is out of bounds
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANIPConnection of a WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPConnection:1
|
|
|
+ * \param[in] index
|
|
|
+ * \param[out] extPort 6 bytes buffer
|
|
|
+ * \param[out] intClient 16 bytes buffer
|
|
|
+ * \param[out] intPort 6 bytes buffer
|
|
|
+ * \param[out] protocol 4 bytes buffer
|
|
|
+ * \param[out] desc 80 bytes buffer
|
|
|
+ * \param[out] enabled 4 bytes buffer
|
|
|
+ * \param[out] rHost 64 bytes buffer
|
|
|
+ * \param[out] duration 16 bytes buffer
|
|
|
+ * \return #UPNPCOMMAND_SUCCESS, #UPNPCOMMAND_INVALID_ARGS,
|
|
|
+ * #UPNPCOMMAND_UNKNOWN_ERROR or a UPnP Error Code.
|
|
|
*/
|
|
|
MINIUPNP_LIBSPEC int
|
|
|
UPNP_GetGenericPortMappingEntry(const char * controlURL,
|
|
@@ -280,14 +433,64 @@ UPNP_GetGenericPortMappingEntry(const char * controlURL,
|
|
|
char * rHost,
|
|
|
char * duration);
|
|
|
|
|
|
-/* UPNP_GetListOfPortMappings() Available in IGD v2
|
|
|
+/*! \brief WANIPConnection:GetGenericPortMappingEntry()
|
|
|
*
|
|
|
+ * errorCode errorDescription (short) | Description (long)
|
|
|
+ * ---------------------------------- | ------------------
|
|
|
+ * 402 Invalid Args | See UPnP Device Architecture section on Control.
|
|
|
+ * 606 Action not authorized | The action requested REQUIRES authorization and the sender was not authorized.
|
|
|
+ * 713 SpecifiedArrayIndexInvalid | The specified array index is out of bounds
|
|
|
*
|
|
|
- * Possible UPNP Error codes :
|
|
|
- * 606 Action not Authorized
|
|
|
- * 730 PortMappingNotFound - no port mapping is found in the specified range.
|
|
|
- * 733 InconsistantParameters - NewStartPort and NewEndPort values are not
|
|
|
- * consistent.
|
|
|
+ * \param[in] controlURL controlURL of the WANIPConnection of a WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPConnection:1
|
|
|
+ * \param[in] index
|
|
|
+ * \param[out] extPort 6 bytes buffer
|
|
|
+ * \param[out] intClient 16 bytes buffer
|
|
|
+ * \param[out] intPort 6 bytes buffer
|
|
|
+ * \param[out] protocol 4 bytes buffer
|
|
|
+ * \param[out] desc desclen bytes buffer
|
|
|
+ * \param[in] desclen desc buffer length
|
|
|
+ * \param[out] enabled 4 bytes buffer
|
|
|
+ * \param[out] rHost desclen bytes buffer
|
|
|
+ * \param[in] rHostlen rHost buffer length
|
|
|
+ * \param[out] duration 16 bytes buffer
|
|
|
+ * \return #UPNPCOMMAND_SUCCESS, #UPNPCOMMAND_INVALID_ARGS,
|
|
|
+ * #UPNPCOMMAND_UNKNOWN_ERROR or a UPnP Error Code.
|
|
|
+ */
|
|
|
+MINIUPNP_LIBSPEC int
|
|
|
+UPNP_GetGenericPortMappingEntryExt(const char * controlURL,
|
|
|
+ const char * servicetype,
|
|
|
+ const char * index,
|
|
|
+ char * extPort,
|
|
|
+ char * intClient,
|
|
|
+ char * intPort,
|
|
|
+ char * protocol,
|
|
|
+ char * desc,
|
|
|
+ size_t desclen,
|
|
|
+ char * enabled,
|
|
|
+ char * rHost,
|
|
|
+ size_t rHostlen,
|
|
|
+ char * duration);
|
|
|
+
|
|
|
+/*! \brief retrieval of a list of existing port mappings
|
|
|
+ *
|
|
|
+ * Available in IGD v2 : WANIPConnection:GetListOfPortMappings()
|
|
|
+ *
|
|
|
+ * errorCode errorDescription (short) | Description (long)
|
|
|
+ * ---------------------------------- | ------------------
|
|
|
+ * 606 Action not authorized | The action requested REQUIRES authorization and the sender was not authorized.
|
|
|
+ * 730 PortMappingNotFound | no port mapping is found in the specified range.
|
|
|
+ * 733 InconsistantParameters | NewStartPort and NewEndPort values are not consistent.
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANIPConnection of a
|
|
|
+ * WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPConnection:2
|
|
|
+ * \param[in] startPort port interval start
|
|
|
+ * \param[in] endPort port interval end
|
|
|
+ * \param[in] protocol `TCP` or `UDP`
|
|
|
+ * \param[in] numberOfPorts size limit of the list returned. `0` to request
|
|
|
+ * all port mappings
|
|
|
+ * \param[out] data port mappings list
|
|
|
*/
|
|
|
MINIUPNP_LIBSPEC int
|
|
|
UPNP_GetListOfPortMappings(const char * controlURL,
|
|
@@ -298,15 +501,48 @@ UPNP_GetListOfPortMappings(const char * controlURL,
|
|
|
const char * numberOfPorts,
|
|
|
struct PortMappingParserData * data);
|
|
|
|
|
|
-/* IGD:2, functions for service WANIPv6FirewallControl:1 */
|
|
|
+/*! \brief GetFirewallStatus() retrieves whether the firewall is enabled
|
|
|
+ * and pinhole can be created through UPnP
|
|
|
+ *
|
|
|
+ * IGD:2, functions for service WANIPv6FirewallControl:1
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANIPv6FirewallControl of a
|
|
|
+ * WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPv6FirewallControl:1
|
|
|
+ * \param[out] firewallEnabled false (0) or true (1)
|
|
|
+ * \param[out] inboundPinholeAllowed false (0) or true (1)
|
|
|
+ * \return #UPNPCOMMAND_UNKNOWN_ERROR, #UPNPCOMMAND_INVALID_ARGS,
|
|
|
+ * #UPNPCOMMAND_HTTP_ERROR, #UPNPCOMMAND_SUCCESS or an UPnP error code
|
|
|
+ */
|
|
|
MINIUPNP_LIBSPEC int
|
|
|
UPNP_GetFirewallStatus(const char * controlURL,
|
|
|
const char * servicetype,
|
|
|
int * firewallEnabled,
|
|
|
int * inboundPinholeAllowed);
|
|
|
|
|
|
+/*! \brief retrieve default value after which automatically created pinholes
|
|
|
+ * expire
|
|
|
+ *
|
|
|
+ * The returned value may be specific to the \p proto, \p remoteHost,
|
|
|
+ * \p remotePort, \p intClient and \p intPort, but this behavior depends
|
|
|
+ * on the implementation of the firewall.
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANIPv6FirewallControl of a
|
|
|
+ * WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPv6FirewallControl:1
|
|
|
+ * \param[in] remoteHost
|
|
|
+ * \param[in] remotePort
|
|
|
+ * \param[in] intClient
|
|
|
+ * \param[in] intPort
|
|
|
+ * \param[in] proto `TCP` or `UDP`
|
|
|
+ * \param[out] opTimeout lifetime in seconds of an inbound "automatic"
|
|
|
+ * firewall pinhole created by an outbound traffic initiation.
|
|
|
+ * \return #UPNPCOMMAND_UNKNOWN_ERROR, #UPNPCOMMAND_INVALID_ARGS,
|
|
|
+ * #UPNPCOMMAND_HTTP_ERROR, #UPNPCOMMAND_SUCCESS or an UPnP error code
|
|
|
+ */
|
|
|
MINIUPNP_LIBSPEC int
|
|
|
-UPNP_GetOutboundPinholeTimeout(const char * controlURL, const char * servicetype,
|
|
|
+UPNP_GetOutboundPinholeTimeout(const char * controlURL,
|
|
|
+ const char * servicetype,
|
|
|
const char * remoteHost,
|
|
|
const char * remotePort,
|
|
|
const char * intClient,
|
|
@@ -314,6 +550,24 @@ UPNP_GetOutboundPinholeTimeout(const char * controlURL, const char * servicetype
|
|
|
const char * proto,
|
|
|
int * opTimeout);
|
|
|
|
|
|
+/*! \brief create a new pinhole that allows incoming traffic to pass
|
|
|
+ * through the firewall
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANIPv6FirewallControl of a
|
|
|
+ * WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPv6FirewallControl:1
|
|
|
+ * \param[in] remoteHost literal presentation of IPv6 address or domain name.
|
|
|
+ * empty string for wildcard
|
|
|
+ * \param[in] remotePort remote host port. Likely 0 (for wildcard)
|
|
|
+ * \param[in] intClient IP address of internal client. cannot be wildcarded
|
|
|
+ * \param[in] intPort client port. 0 for wildcard
|
|
|
+ * \param[in] proto IP protocol integer (6 for TCP, 17 for UDP, etc.)
|
|
|
+ * 65535 for wildcard.
|
|
|
+ * \param[in] leaseTime in seconds
|
|
|
+ * \param[out] uniqueID 8 bytes buffer
|
|
|
+ * \return #UPNPCOMMAND_UNKNOWN_ERROR, #UPNPCOMMAND_INVALID_ARGS,
|
|
|
+ * #UPNPCOMMAND_HTTP_ERROR, #UPNPCOMMAND_SUCCESS or an UPnP error code
|
|
|
+ */
|
|
|
MINIUPNP_LIBSPEC int
|
|
|
UPNP_AddPinhole(const char * controlURL, const char * servicetype,
|
|
|
const char * remoteHost,
|
|
@@ -324,18 +578,61 @@ UPNP_AddPinhole(const char * controlURL, const char * servicetype,
|
|
|
const char * leaseTime,
|
|
|
char * uniqueID);
|
|
|
|
|
|
+/*! \brief update a pinhole’s lease time
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANIPv6FirewallControl of a
|
|
|
+ * WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPv6FirewallControl:1
|
|
|
+ * \param[in] uniqueID value obtained through UPNP_AddPinhole()
|
|
|
+ * \param[in] leaseTime in seconds
|
|
|
+ * \return #UPNPCOMMAND_UNKNOWN_ERROR, #UPNPCOMMAND_INVALID_ARGS,
|
|
|
+ * #UPNPCOMMAND_HTTP_ERROR, #UPNPCOMMAND_SUCCESS or an UPnP error code
|
|
|
+ */
|
|
|
MINIUPNP_LIBSPEC int
|
|
|
UPNP_UpdatePinhole(const char * controlURL, const char * servicetype,
|
|
|
const char * uniqueID,
|
|
|
const char * leaseTime);
|
|
|
|
|
|
+/*! \brief remove a pinhole
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANIPv6FirewallControl of a
|
|
|
+ * WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPv6FirewallControl:1
|
|
|
+ * \param[in] uniqueID value obtained through UPNP_AddPinhole()
|
|
|
+ * \return #UPNPCOMMAND_UNKNOWN_ERROR, #UPNPCOMMAND_INVALID_ARGS,
|
|
|
+ * #UPNPCOMMAND_HTTP_ERROR, #UPNPCOMMAND_SUCCESS or an UPnP error code
|
|
|
+ */
|
|
|
MINIUPNP_LIBSPEC int
|
|
|
-UPNP_DeletePinhole(const char * controlURL, const char * servicetype, const char * uniqueID);
|
|
|
+UPNP_DeletePinhole(const char * controlURL,
|
|
|
+ const char * servicetype,
|
|
|
+ const char * uniqueID);
|
|
|
|
|
|
+/*! \brief checking if a certain pinhole allows traffic to pass through the firewall
|
|
|
+ *
|
|
|
+ * \param[in] controlURL controlURL of the WANIPv6FirewallControl of a
|
|
|
+ * WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPv6FirewallControl:1
|
|
|
+ * \param[in] uniqueID value obtained through UPNP_AddPinhole()
|
|
|
+ * \param[out] isWorking `0` for false, `1` for true
|
|
|
+ * \return #UPNPCOMMAND_UNKNOWN_ERROR, #UPNPCOMMAND_INVALID_ARGS,
|
|
|
+ * #UPNPCOMMAND_HTTP_ERROR, #UPNPCOMMAND_SUCCESS or an UPnP error code
|
|
|
+ */
|
|
|
MINIUPNP_LIBSPEC int
|
|
|
UPNP_CheckPinholeWorking(const char * controlURL, const char * servicetype,
|
|
|
const char * uniqueID, int * isWorking);
|
|
|
|
|
|
+/*! \brief get the total number of IP packets which have been going through
|
|
|
+ * the specified pinhole
|
|
|
+ * \todo \p packets should be #UNSIGNED_INTEGER
|
|
|
+ * \param[in] controlURL controlURL of the WANIPv6FirewallControl of a
|
|
|
+ * WANConnectionDevice
|
|
|
+ * \param[in] servicetype urn:schemas-upnp-org:service:WANIPv6FirewallControl:1
|
|
|
+ * \param[in] uniqueID value obtained through UPNP_AddPinhole()
|
|
|
+ * \param[out] packets how many IP packets have been going through the
|
|
|
+ * specified pinhole
|
|
|
+ * \return #UPNPCOMMAND_UNKNOWN_ERROR, #UPNPCOMMAND_INVALID_ARGS,
|
|
|
+ * #UPNPCOMMAND_HTTP_ERROR, #UPNPCOMMAND_SUCCESS or an UPnP error code
|
|
|
+ */
|
|
|
MINIUPNP_LIBSPEC int
|
|
|
UPNP_GetPinholePackets(const char * controlURL, const char * servicetype,
|
|
|
const char * uniqueID, int * packets);
|