Electroneum
portlistingparse.h
Go to the documentation of this file.
1
/* $Id: portlistingparse.h,v 1.10 2014/11/01 10:37:32 nanard Exp $ */
2
/* MiniUPnP project
3
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
4
* (c) 2011-2015 Thomas Bernard
5
* This software is subject to the conditions detailed
6
* in the LICENCE file provided within the distribution */
7
#ifndef PORTLISTINGPARSE_H_INCLUDED
8
#define PORTLISTINGPARSE_H_INCLUDED
9
10
#include "
miniupnpc_declspec.h
"
11
/* for the definition of UNSIGNED_INTEGER */
12
#include "
miniupnpctypes.h
"
13
14
#ifdef __cplusplus
15
extern
"C"
{
16
#endif
17
18
/* sample of PortMappingEntry :
19
<p:PortMappingEntry>
20
<p:NewRemoteHost>202.233.2.1</p:NewRemoteHost>
21
<p:NewExternalPort>2345</p:NewExternalPort>
22
<p:NewProtocol>TCP</p:NewProtocol>
23
<p:NewInternalPort>2345</p:NewInternalPort>
24
<p:NewInternalClient>192.168.1.137</p:NewInternalClient>
25
<p:NewEnabled>1</p:NewEnabled>
26
<p:NewDescription>dooom</p:NewDescription>
27
<p:NewLeaseTime>345</p:NewLeaseTime>
28
</p:PortMappingEntry>
29
*/
30
typedef
enum
{
PortMappingEltNone
,
31
PortMappingEntry
,
NewRemoteHost
,
32
NewExternalPort
,
NewProtocol
,
33
NewInternalPort
,
NewInternalClient
,
34
NewEnabled
,
NewDescription
,
35
NewLeaseTime
}
portMappingElt
;
36
37
struct
PortMapping
{
38
struct
PortMapping
*
l_next
;
/* list next element */
39
UNSIGNED_INTEGER
leaseTime
;
40
unsigned
short
externalPort
;
41
unsigned
short
internalPort
;
42
char
remoteHost
[64];
43
char
internalClient
[64];
44
char
description
[64];
45
char
protocol
[4];
46
unsigned
char
enabled
;
47
};
48
49
struct
PortMappingParserData
{
50
struct
PortMapping
*
l_head
;
/* list head */
51
portMappingElt
curelt
;
52
};
53
54
MINIUPNP_LIBSPEC
void
55
ParsePortListing
(
const
char
* buffer,
int
bufsize,
56
struct
PortMappingParserData
* pdata);
57
58
MINIUPNP_LIBSPEC
void
59
FreePortListing
(
struct
PortMappingParserData
* pdata);
60
61
#ifdef __cplusplus
62
}
63
#endif
64
65
#endif
MINIUPNP_LIBSPEC
#define MINIUPNP_LIBSPEC
Definition:
miniupnpc_declspec.h:16
FreePortListing
MINIUPNP_LIBSPEC void FreePortListing(struct PortMappingParserData *pdata)
PortMapping::externalPort
unsigned short externalPort
Definition:
portlistingparse.h:40
portMappingElt
portMappingElt
Definition:
portlistingparse.h:30
miniupnpctypes.h
NewLeaseTime
Definition:
portlistingparse.h:35
PortMappingEntry
Definition:
portlistingparse.h:31
PortMapping::internalPort
unsigned short internalPort
Definition:
portlistingparse.h:41
PortMapping::remoteHost
char remoteHost[64]
Definition:
portlistingparse.h:42
NewDescription
Definition:
portlistingparse.h:34
PortMapping
Definition:
portlistingparse.h:37
PortMapping::leaseTime
UNSIGNED_INTEGER leaseTime
Definition:
portlistingparse.h:39
NewExternalPort
Definition:
portlistingparse.h:32
ParsePortListing
MINIUPNP_LIBSPEC void ParsePortListing(const char *buffer, int bufsize, struct PortMappingParserData *pdata)
UNSIGNED_INTEGER
#define UNSIGNED_INTEGER
Definition:
miniupnpctypes.h:14
NewInternalClient
Definition:
portlistingparse.h:33
PortMappingEltNone
Definition:
portlistingparse.h:30
PortMapping::description
char description[64]
Definition:
portlistingparse.h:44
PortMappingParserData
Definition:
portlistingparse.h:49
PortMappingParserData::l_head
struct PortMapping * l_head
Definition:
portlistingparse.h:50
PortMapping::internalClient
char internalClient[64]
Definition:
portlistingparse.h:43
PortMapping::protocol
char protocol[4]
Definition:
portlistingparse.h:45
NewEnabled
Definition:
portlistingparse.h:34
NewInternalPort
Definition:
portlistingparse.h:33
miniupnpc_declspec.h
NewProtocol
Definition:
portlistingparse.h:32
NewRemoteHost
Definition:
portlistingparse.h:31
PortMappingParserData::curelt
portMappingElt curelt
Definition:
portlistingparse.h:51
PortMapping::enabled
unsigned char enabled
Definition:
portlistingparse.h:46
PortMapping::l_next
struct PortMapping * l_next
Definition:
portlistingparse.h:38
external
miniupnp
miniupnpc
portlistingparse.h
Generated on Sun Mar 10 2024 12:00:00 for Electroneum by
1.8.14