aboutsummaryrefslogtreecommitdiff
path: root/src/nat/miniupnp/upnpcommands.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nat/miniupnp/upnpcommands.h')
-rw-r--r--src/nat/miniupnp/upnpcommands.h189
1 files changed, 0 insertions, 189 deletions
diff --git a/src/nat/miniupnp/upnpcommands.h b/src/nat/miniupnp/upnpcommands.h
deleted file mode 100644
index fa1d604ae..000000000
--- a/src/nat/miniupnp/upnpcommands.h
+++ /dev/null
@@ -1,189 +0,0 @@
1/* $Id: upnpcommands.h,v 1.17 2009/04/17 21:21:19 nanard Exp $ */
2/* Miniupnp project : http://miniupnp.free.fr/
3 * Author : Thomas Bernard
4 * Copyright (c) 2005-2008 Thomas Bernard
5 * This software is subject to the conditions detailed in the
6 * LICENCE file provided within this distribution */
7#ifndef __UPNPCOMMANDS_H__
8#define __UPNPCOMMANDS_H__
9
10#include "upnpreplyparse.h"
11#include "declspec.h"
12
13/* MiniUPnPc return codes : */
14#define UPNPCOMMAND_SUCCESS (0)
15#define UPNPCOMMAND_UNKNOWN_ERROR (-1)
16#define UPNPCOMMAND_INVALID_ARGS (-2)
17
18#ifdef __cplusplus
19extern "C"
20{
21#endif
22
23#if (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
24#define UNSIGNED_INTEGER unsigned long long
25#define STRTOUI strtoull
26#else
27#define UNSIGNED_INTEGER unsigned int
28#define STRTOUI strtoul
29#endif
30
31 LIBSPEC UNSIGNED_INTEGER
32 UPNP_GetTotalBytesSent (const char *controlURL, const char *servicetype);
33
34 LIBSPEC UNSIGNED_INTEGER
35 UPNP_GetTotalBytesReceived (const char *controlURL,
36 const char *servicetype);
37
38 LIBSPEC UNSIGNED_INTEGER
39 UPNP_GetTotalPacketsSent (const char *controlURL,
40 const char *servicetype);
41
42 LIBSPEC UNSIGNED_INTEGER
43 UPNP_GetTotalPacketsReceived (const char *controlURL,
44 const char *servicetype);
45
46/* UPNP_GetStatusInfo()
47 * status and lastconnerror are 64 byte buffers
48 * Return values :
49 * UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR
50 * or a UPnP Error code */
51 LIBSPEC int
52 UPNP_GetStatusInfo (const char *controlURL,
53 const char *servicetype,
54 char *status,
55 unsigned int *uptime, char *lastconnerror);
56
57/* UPNP_GetConnectionTypeInfo()
58 * argument connectionType is a 64 character buffer
59 * Return Values :
60 * UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR
61 * or a UPnP Error code */
62 LIBSPEC int
63 UPNP_GetConnectionTypeInfo (const char *controlURL,
64 const char *servicetype,
65 char *connectionType);
66
67/* UPNP_GetExternalIPAddress() call the corresponding UPNP method.
68 * if the third arg is not null the value is copied to it.
69 * at least 128 bytes must be available
70 *
71 * Return values :
72 * 0 : SUCCESS
73 * NON ZERO : ERROR Either an UPnP error code or an unknown error.
74 *
75 * possible UPnP Errors :
76 * 402 Invalid Args - See UPnP Device Architecture section on Control.
77 * 501 Action Failed - See UPnP Device Architecture section on Control. */
78 LIBSPEC int
79 UPNP_GetExternalIPAddress (const char *controlURL,
80 const char *servicetype, char *extIpAdd);
81
82/* UPNP_GetLinkLayerMaxBitRates()
83 * call WANCommonInterfaceConfig:1#GetCommonLinkProperties
84 *
85 * return values :
86 * UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR
87 * or a UPnP Error Code. */
88 LIBSPEC int
89 UPNP_GetLinkLayerMaxBitRates (const char *controlURL,
90 const char *servicetype,
91 unsigned int *bitrateDown,
92 unsigned int *bitrateUp);
93
94/* UPNP_AddPortMapping()
95 * if desc is NULL, it will be defaulted to "libminiupnpc"
96 * remoteHost is usually NULL because IGD don't support it.
97 *
98 * Return values :
99 * 0 : SUCCESS
100 * NON ZERO : ERROR. Either an UPnP error code or an unknown error.
101 *
102 * List of possible UPnP errors for AddPortMapping :
103 * errorCode errorDescription (short) - Description (long)
104 * 402 Invalid Args - See UPnP Device Architecture section on Control.
105 * 501 Action Failed - See UPnP Device Architecture section on Control.
106 * 715 WildCardNotPermittedInSrcIP - The source IP address cannot be
107 * wild-carded
108 * 716 WildCardNotPermittedInExtPort - The external port cannot be wild-carded
109 * 718 ConflictInMappingEntry - The port mapping entry specified conflicts
110 * with a mapping assigned previously to another client
111 * 724 SamePortValuesRequired - Internal and External port values
112 * must be the same
113 * 725 OnlyPermanentLeasesSupported - The NAT implementation only supports
114 * permanent lease times on port mappings
115 * 726 RemoteHostOnlySupportsWildcard - RemoteHost must be a wildcard
116 * and cannot be a specific IP address or DNS name
117 * 727 ExternalPortOnlySupportsWildcard - ExternalPort must be a wildcard and
118 * cannot be a specific port value */
119 LIBSPEC int
120 UPNP_AddPortMapping (const char *controlURL, const char *servicetype,
121 const char *extPort,
122 const char *inPort,
123 const char *inClient,
124 const char *desc,
125 const char *proto, const char *remoteHost);
126
127/* UPNP_DeletePortMapping()
128 * Use same argument values as what was used for AddPortMapping().
129 * remoteHost is usually NULL because IGD don't support it.
130 * Return Values :
131 * 0 : SUCCESS
132 * NON ZERO : error. Either an UPnP error code or an undefined error.
133 *
134 * List of possible UPnP errors for DeletePortMapping :
135 * 402 Invalid Args - See UPnP Device Architecture section on Control.
136 * 714 NoSuchEntryInArray - The specified value does not exist in the array */
137 LIBSPEC int
138 UPNP_DeletePortMapping (const char *controlURL, const char *servicetype,
139 const char *extPort, const char *proto,
140 const char *remoteHost);
141
142/* UPNP_GetPortMappingNumberOfEntries()
143 * not supported by all routers */
144 LIBSPEC int
145 UPNP_GetPortMappingNumberOfEntries (const char *controlURL,
146 const char *servicetype,
147 unsigned int *num);
148
149/* UPNP_GetSpecificPortMappingEntry retrieves an existing port mapping
150 * the result is returned in the intClient and intPort strings
151 * please provide 128 and 6 bytes of data
152 *
153 * return value :
154 * UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR
155 * or a UPnP Error Code. */
156 LIBSPEC int
157 UPNP_GetSpecificPortMappingEntry (const char *controlURL,
158 const char *servicetype,
159 const char *extPort,
160 const char *proto,
161 char *intClient, char *intPort);
162
163/* UPNP_GetGenericPortMappingEntry()
164 *
165 * return value :
166 * UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR
167 * or a UPnP Error Code.
168 *
169 * Possible UPNP Error codes :
170 * 402 Invalid Args - See UPnP Device Architecture section on Control.
171 * 713 SpecifiedArrayIndexInvalid - The specified array index is out of bounds
172 */
173 LIBSPEC int
174 UPNP_GetGenericPortMappingEntry (const char *controlURL,
175 const char *servicetype,
176 const char *index,
177 char *extPort,
178 char *intClient,
179 char *intPort,
180 char *protocol,
181 char *desc,
182 char *enabled,
183 char *rHost, char *duration);
184
185#ifdef __cplusplus
186}
187#endif
188
189#endif