~ubuntu-branches/ubuntu/precise/miniupnpc/precise-updates

« back to all changes in this revision

Viewing changes to upnpcommands.h

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2011-12-06 15:39:46 UTC
  • mfrom: (2.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20111206153946-r15zvcdgwamzct0c
Tags: 1.6-3ubuntu1
* Resynchronized on Debian using their git version, remaining difference:
* control: suggests minissdpd rather than recommends, it's in universe

Show diffs side-by-side

added added

removed removed

Lines of Context:
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__
9
9
 
10
10
#include "upnpreplyparse.h"
 
11
#include "portlistingparse.h"
11
12
#include "declspec.h"
 
13
#include "miniupnpctypes.h"
12
14
 
13
15
/* MiniUPnPc return codes : */
14
16
#define UPNPCOMMAND_SUCCESS (0)
20
22
extern "C" {
21
23
#endif
22
24
 
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
25
LIBSPEC UNSIGNED_INTEGER
32
26
UPNP_GetTotalBytesSent(const char * controlURL,
33
27
                                        const char * servicetype);
126
120
                                        const char * inClient,
127
121
                                        const char * desc,
128
122
                    const char * proto,
129
 
                    const char * remoteHost);
 
123
                    const char * remoteHost,
 
124
                    const char * leaseDuration);
130
125
 
131
126
/* UPNP_DeletePortMapping()
132
127
 * Use same argument values as what was used for AddPortMapping().
146
141
/* UPNP_GetPortMappingNumberOfEntries()
147
142
 * not supported by all routers */
148
143
LIBSPEC int
149
 
UPNP_GetPortMappingNumberOfEntries(const char* controlURL, const char* servicetype, unsigned int * num);
 
144
UPNP_GetPortMappingNumberOfEntries(const char* controlURL,
 
145
                                   const char* servicetype,
 
146
                                   unsigned int * num);
150
147
 
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
 
150
 * params :
 
151
 *  in   extPort
 
152
 *  in   proto
 
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)
154
158
 *
155
159
 * return value :
156
160
 * UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR
161
165
                                 const char * extPort,
162
166
                                 const char * proto,
163
167
                                 char * intClient,
164
 
                                 char * intPort);
 
168
                                 char * intPort,
 
169
                                 char * desc,
 
170
                                 char * enabled,
 
171
                                 char * leaseDuration);
165
172
 
166
173
/* UPNP_GetGenericPortMappingEntry()
 
174
 * params :
 
175
 *  in   index
 
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)
167
184
 *
168
185
 * return value :
169
186
 * UPNPCOMMAND_SUCCESS, UPNPCOMMAND_INVALID_ARGS, UPNPCOMMAND_UNKNOWN_ERROR
186
203
                                                                char * rHost,
187
204
                                                                char * duration);
188
205
 
 
206
/* UPNP_GetListOfPortMappings()      Available in IGD v2
 
207
 *
 
208
 *
 
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
 
213
 *                              consistent.
 
214
 */
 
215
LIBSPEC int
 
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);
 
223
 
 
224
/* IGD:2, functions for service WANIPv6FirewallControl:1 */ 
 
225
LIBSPEC int
 
226
UPNP_GetFirewallStatus(const char * controlURL,
 
227
                                const char * servicetype,
 
228
                                int * firewallEnabled, 
 
229
                                int * inboundPinholeAllowed);
 
230
 
 
231
LIBSPEC int
 
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,
 
237
                    const char * proto,
 
238
                    int * opTimeout);
 
239
 
 
240
LIBSPEC int
 
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,
 
246
                    const char * proto,
 
247
                    const char * leaseTime,
 
248
                    char * uniqueID);
 
249
 
 
250
LIBSPEC int
 
251
UPNP_UpdatePinhole(const char * controlURL, const char * servicetype,
 
252
                    const char * uniqueID,
 
253
                    const char * leaseTime);
 
254
 
 
255
LIBSPEC int
 
256
UPNP_DeletePinhole(const char * controlURL, const char * servicetype, const char * uniqueID);
 
257
 
 
258
LIBSPEC int
 
259
UPNP_CheckPinholeWorking(const char * controlURL, const char * servicetype,
 
260
                                 const char * uniqueID, int * isWorking);
 
261
 
 
262
LIBSPEC int
 
263
UPNP_GetPinholePackets(const char * controlURL, const char * servicetype,
 
264
                                 const char * uniqueID, int * packets);
 
265
 
189
266
#ifdef __cplusplus
190
267
}
191
268
#endif