Annotation of embedaddon/miniupnpc/portlistingparse.h, revision 1.1.1.2
1.1.1.2 ! misho 1: /* $Id: portlistingparse.h,v 1.7 2012/09/27 15:42:10 nanard Exp $ */
1.1 misho 2: /* MiniUPnP project
3: * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
1.1.1.2 ! misho 4: * (c) 2011-2012 Thomas Bernard
1.1 misho 5: * This software is subject to the conditions detailed
6: * in the LICENCE file provided within the distribution */
1.1.1.2 ! misho 7: #ifndef PORTLISTINGPARSE_H_INCLUDED
! 8: #define PORTLISTINGPARSE_H_INCLUDED
1.1 misho 9:
10: #include "declspec.h"
11: /* for the definition of UNSIGNED_INTEGER */
12: #include "miniupnpctypes.h"
13:
1.1.1.2 ! misho 14: #if defined(NO_SYS_QUEUE_H) || defined(_WIN32) || defined(__HAIKU__)
1.1 misho 15: #include "bsdqueue.h"
16: #else
17: #include <sys/queue.h>
18: #endif
19:
20: #ifdef __cplusplus
21: extern "C" {
22: #endif
23:
24: /* sample of PortMappingEntry :
25: <p:PortMappingEntry>
26: <p:NewRemoteHost>202.233.2.1</p:NewRemoteHost>
27: <p:NewExternalPort>2345</p:NewExternalPort>
28: <p:NewProtocol>TCP</p:NewProtocol>
29: <p:NewInternalPort>2345</p:NewInternalPort>
30: <p:NewInternalClient>192.168.1.137</p:NewInternalClient>
31: <p:NewEnabled>1</p:NewEnabled>
32: <p:NewDescription>dooom</p:NewDescription>
33: <p:NewLeaseTime>345</p:NewLeaseTime>
34: </p:PortMappingEntry>
35: */
36: typedef enum { PortMappingEltNone,
37: PortMappingEntry, NewRemoteHost,
38: NewExternalPort, NewProtocol,
39: NewInternalPort, NewInternalClient,
1.1.1.2 ! misho 40: NewEnabled, NewDescription,
1.1 misho 41: NewLeaseTime } portMappingElt;
42:
43: struct PortMapping {
44: LIST_ENTRY(PortMapping) entries;
45: UNSIGNED_INTEGER leaseTime;
46: unsigned short externalPort;
47: unsigned short internalPort;
48: char remoteHost[64];
49: char internalClient[64];
50: char description[64];
51: char protocol[4];
52: unsigned char enabled;
53: };
54:
55: struct PortMappingParserData {
56: LIST_HEAD(portmappinglisthead, PortMapping) head;
57: portMappingElt curelt;
58: };
59:
60: LIBSPEC void
61: ParsePortListing(const char * buffer, int bufsize,
62: struct PortMappingParserData * pdata);
63:
64: LIBSPEC void
65: FreePortListing(struct PortMappingParserData * pdata);
66:
67: #ifdef __cplusplus
68: }
69: #endif
70:
71: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>