1
/* $Id: upnpcommands.h,v 1.18 2010/06/09 10:59:09 nanard Exp $ */
1
/* $Id: upnpcommands.h,v 1.23 2011/04/11 09:14:00 nanard Exp $ */
2
2
/* Miniupnp project : http://miniupnp.free.fr/
3
3
* Author : Thomas Bernard
4
* Copyright (c) 2005-2010 Thomas Bernard
4
* Copyright (c) 2005-2011 Thomas Bernard
5
5
* This software is subject to the conditions detailed in the
6
6
* LICENCE file provided within this distribution */
7
7
#ifndef __UPNPCOMMANDS_H__
8
8
#define __UPNPCOMMANDS_H__
10
10
#include "upnpreplyparse.h"
11
#include "portlistingparse.h"
11
12
#include "declspec.h"
13
#include "miniupnpctypes.h"
13
15
/* MiniUPnPc return codes : */
14
16
#define UPNPCOMMAND_SUCCESS (0)
23
#if (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
24
#define UNSIGNED_INTEGER unsigned long long
25
#define STRTOUI strtoull
27
#define UNSIGNED_INTEGER unsigned int
28
#define STRTOUI strtoul
31
25
LIBSPEC UNSIGNED_INTEGER
32
26
UPNP_GetTotalBytesSent(const char * controlURL,
33
27
const char * servicetype);
146
141
/* UPNP_GetPortMappingNumberOfEntries()
147
142
* not supported by all routers */
149
UPNP_GetPortMappingNumberOfEntries(const char* controlURL, const char* servicetype, unsigned int * num);
144
UPNP_GetPortMappingNumberOfEntries(const char* controlURL,
145
const char* servicetype,
151
/* UPNP_GetSpecificPortMappingEntry retrieves an existing port mapping
152
* the result is returned in the intClient and intPort strings
153
* please provide 16 and 6 bytes of data
148
/* UPNP_GetSpecificPortMappingEntry()
149
* retrieves an existing port mapping
153
* out intClient (16 bytes)
154
* out intPort (6 bytes)
155
* out desc (80 bytes)
156
* out enabled (4 bytes)
157
* out leaseDuration (16 bytes)
156
160
* UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR
161
165
const char * extPort,
162
166
const char * proto,
163
167
char * intClient,
171
char * leaseDuration);
166
173
/* UPNP_GetGenericPortMappingEntry()
176
* out extPort (6 bytes)
177
* out intClient (16 bytes)
178
* out intPort (6 bytes)
179
* out protocol (4 bytes)
180
* out desc (80 bytes)
181
* out enabled (4 bytes)
182
* out rHost (64 bytes)
183
* out duration (16 bytes)
169
186
* UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR
187
204
char * duration);
206
/* UPNP_GetListOfPortMappings() Available in IGD v2
209
* Possible UPNP Error codes :
210
* 606 Action not Authorized
211
* 730 PortMappingNotFound - no port mapping is found in the specified range.
212
* 733 InconsistantParameters - NewStartPort and NewEndPort values are not
216
UPNP_GetListOfPortMappings(const char * controlURL,
217
const char * servicetype,
218
const char * startPort,
219
const char * endPort,
220
const char * protocol,
221
const char * numberOfPorts,
222
struct PortMappingParserData * data);
224
/* IGD:2, functions for service WANIPv6FirewallControl:1 */
226
UPNP_GetFirewallStatus(const char * controlURL,
227
const char * servicetype,
228
int * firewallEnabled,
229
int * inboundPinholeAllowed);
232
UPNP_GetOutboundPinholeTimeout(const char * controlURL, const char * servicetype,
233
const char * remoteHost,
234
const char * remotePort,
235
const char * intClient,
236
const char * intPort,
241
UPNP_AddPinhole(const char * controlURL, const char * servicetype,
242
const char * remoteHost,
243
const char * remotePort,
244
const char * intClient,
245
const char * intPort,
247
const char * leaseTime,
251
UPNP_UpdatePinhole(const char * controlURL, const char * servicetype,
252
const char * uniqueID,
253
const char * leaseTime);
256
UPNP_DeletePinhole(const char * controlURL, const char * servicetype, const char * uniqueID);
259
UPNP_CheckPinholeWorking(const char * controlURL, const char * servicetype,
260
const char * uniqueID, int * isWorking);
263
UPNP_GetPinholePackets(const char * controlURL, const char * servicetype,
264
const char * uniqueID, int * packets);
189
266
#ifdef __cplusplus