source: Daodan/MinGW/include/iptypes.h@ 1054

Last change on this file since 1054 was 1046, checked in by alloc, 8 years ago

Daodan: Added Windows MinGW and build batch file

File size: 6.3 KB
Line 
1#ifndef _IPTYPES_H
2#define _IPTYPES_H
3#if __GNUC__ >= 3
4#pragma GCC system_header
5#endif
6
7#include <sys/types.h>
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12#define DEFAULT_MINIMUM_ENTITIES 32
13#define MAX_ADAPTER_ADDRESS_LENGTH 8
14#define MAX_ADAPTER_DESCRIPTION_LENGTH 128
15#define MAX_ADAPTER_NAME_LENGTH 256
16#define MAX_DOMAIN_NAME_LEN 128
17#define MAX_HOSTNAME_LEN 128
18#define MAX_SCOPE_ID_LEN 256
19#define BROADCAST_NODETYPE 1
20#define PEER_TO_PEER_NODETYPE 2
21#define MIXED_NODETYPE 4
22#define HYBRID_NODETYPE 8
23#define IF_OTHER_ADAPTERTYPE 0
24#define IF_ETHERNET_ADAPTERTYPE 1
25#define IF_TOKEN_RING_ADAPTERTYPE 2
26#define IF_FDDI_ADAPTERTYPE 3
27#define IF_PPP_ADAPTERTYPE 4
28#define IF_LOOPBACK_ADAPTERTYPE 5
29#if (_WIN32_WINNT >= 0x0501)
30#define IP_ADAPTER_DDNS_ENABLED 0x00000001
31#define IP_ADAPTER_REGISTER_ADAPTER_SUFFIX 0x00000002
32#define IP_ADAPTER_DHCP_ENABLED 0x00000004
33#define IP_ADAPTER_RECEIVE_ONLY 0x00000008
34#define IP_ADAPTER_NO_MULTICAST 0x00000010
35#define IP_ADAPTER_IPV6_OTHER_STATEFUL_CONFIG 0x00000020
36#define IP_ADAPTER_ADDRESS_DNS_ELIGIBLE 0x00000001
37#define IP_ADAPTER_ADDRESS_TRANSIENT 0x00000002
38#endif
39
40typedef struct {
41 char String[16];
42} IP_ADDRESS_STRING, *PIP_ADDRESS_STRING, IP_MASK_STRING, *PIP_MASK_STRING;
43typedef struct _IP_ADDR_STRING {
44 struct _IP_ADDR_STRING* Next;
45 IP_ADDRESS_STRING IpAddress;
46 IP_MASK_STRING IpMask;
47 DWORD Context;
48} IP_ADDR_STRING, *PIP_ADDR_STRING;
49typedef struct _IP_ADAPTER_INFO {
50 struct _IP_ADAPTER_INFO* Next;
51 DWORD ComboIndex;
52 char AdapterName[MAX_ADAPTER_NAME_LENGTH+4];
53 char Description[MAX_ADAPTER_DESCRIPTION_LENGTH+4];
54 UINT AddressLength;
55 BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH];
56 DWORD Index;
57 UINT Type;
58 UINT DhcpEnabled;
59 PIP_ADDR_STRING CurrentIpAddress;
60 IP_ADDR_STRING IpAddressList;
61 IP_ADDR_STRING GatewayList;
62 IP_ADDR_STRING DhcpServer;
63 BOOL HaveWins;
64 IP_ADDR_STRING PrimaryWinsServer;
65 IP_ADDR_STRING SecondaryWinsServer;
66 time_t LeaseObtained;
67 time_t LeaseExpires;
68} IP_ADAPTER_INFO, *PIP_ADAPTER_INFO;
69typedef struct _IP_PER_ADAPTER_INFO {
70 UINT AutoconfigEnabled;
71 UINT AutoconfigActive;
72 PIP_ADDR_STRING CurrentDnsServer;
73 IP_ADDR_STRING DnsServerList;
74} IP_PER_ADAPTER_INFO, *PIP_PER_ADAPTER_INFO;
75typedef struct _FIXED_INFO {
76 char HostName[MAX_HOSTNAME_LEN+4] ;
77 char DomainName[MAX_DOMAIN_NAME_LEN+4];
78 PIP_ADDR_STRING CurrentDnsServer;
79 IP_ADDR_STRING DnsServerList;
80 UINT NodeType;
81 char ScopeId[MAX_SCOPE_ID_LEN+4];
82 UINT EnableRouting;
83 UINT EnableProxy;
84 UINT EnableDns;
85} FIXED_INFO, *PFIXED_INFO;
86#if (_WIN32_WINNT >= 0x0501) && defined(_WINSOCK2_H)
87typedef enum {
88 IfOperStatusUp = 1,
89 IfOperStatusDown,
90 IfOperStatusTesting,
91 IfOperStatusUnknown,
92 IfOperStatusDormant,
93 IfOperStatusNotPresent,
94 IfOperStatusLowerLayerDown
95} IF_OPER_STATUS;
96typedef enum {
97 IpDadStateInvalid = 0,
98 IpDadStateTentative,
99 IpDadStateDuplicate,
100 IpDadStateDeprecated,
101 IpDadStatePreferred
102} IP_DAD_STATE;
103typedef enum {
104 IpPrefixOriginOther = 0,
105 IpPrefixOriginManual,
106 IpPrefixOriginWellKnown,
107 IpPrefixOriginDhcp,
108 IpPrefixOriginRouterAdvertisement
109} IP_PREFIX_ORIGIN;
110typedef enum {
111 IpSuffixOriginOther = 0,
112 IpSuffixOriginManual,
113 IpSuffixOriginWellKnown,
114 IpSuffixOriginDhcp,
115 IpSuffixOriginLinkLayerAddress,
116 IpSuffixOriginRandom
117} IP_SUFFIX_ORIGIN;
118typedef enum {
119 ScopeLevelInterface = 1,
120 ScopeLevelLink = 2,
121 ScopeLevelSubnet = 3,
122 ScopeLevelAdmin = 4,
123 ScopeLevelSite = 5,
124 ScopeLevelOrganization = 8,
125 ScopeLevelGlobal = 14
126} SCOPE_LEVEL;
127typedef struct {
128 ULONG Index;
129 ULONG MediaType;
130 UCHAR ConnectionType;
131 UCHAR AccessType;
132 GUID DeviceGuid;
133 GUID InterfaceGuid;
134} IP_INTERFACE_NAME_INFO,*PIP_INTERFACE_NAME_INFO;
135typedef struct _IP_ADAPTER_ANYCAST_ADDRESS {
136 _ANONYMOUS_UNION union {
137 ULONGLONG Alignment;
138 _ANONYMOUS_STRUCT struct {
139 ULONG Length;
140 DWORD Flags;
141 } DUMMYSTRUCTNAME;
142 } DUMMYUNIONNAME;
143 struct _IP_ADAPTER_ANYCAST_ADDRESS* Next;
144 SOCKET_ADDRESS Address;
145} IP_ADAPTER_ANYCAST_ADDRESS,*PIP_ADAPTER_ANYCAST_ADDRESS;
146typedef struct _IP_ADAPTER_MULTICAST_ADDRESS {
147 _ANONYMOUS_UNION union {
148 ULONGLONG Alignment;
149 _ANONYMOUS_STRUCT struct {
150 ULONG Length;
151 DWORD Flags;
152 } DUMMYSTRUCTNAME;
153 } DUMMYUNIONNAME;
154 struct _IP_ADAPTER_MULTICAST_ADDRESS* Next;
155 SOCKET_ADDRESS Address;
156} IP_ADAPTER_MULTICAST_ADDRESS,*PIP_ADAPTER_MULTICAST_ADDRESS;
157typedef struct _IP_ADAPTER_UNICAST_ADDRESS {
158 _ANONYMOUS_UNION union {
159 ULONGLONG Alignment;
160 _ANONYMOUS_STRUCT struct {
161 ULONG Length;
162 DWORD Flags;
163 } DUMMYSTRUCTNAME;
164 } DUMMYUNIONNAME;
165 struct _IP_ADAPTER_UNICAST_ADDRESS* Next;
166 SOCKET_ADDRESS Address;
167 IP_PREFIX_ORIGIN PrefixOrigin;
168 IP_SUFFIX_ORIGIN SuffixOrigin;
169 IP_DAD_STATE DadState;
170 ULONG ValidLifetime;
171 ULONG PreferredLifetime;
172 ULONG LeaseLifetime;
173} IP_ADAPTER_UNICAST_ADDRESS,*PIP_ADAPTER_UNICAST_ADDRESS;
174typedef struct _IP_ADAPTER_DNS_SERVER_ADDRESS {
175 _ANONYMOUS_UNION union {
176 ULONGLONG Alignment;
177 _ANONYMOUS_STRUCT struct {
178 ULONG Length;
179 DWORD Reserved;
180 } DUMMYSTRUCTNAME;
181 } DUMMYUNIONNAME;
182 struct _IP_ADAPTER_DNS_SERVER_ADDRESS* Next;
183 SOCKET_ADDRESS Address;
184} IP_ADAPTER_DNS_SERVER_ADDRESS,*PIP_ADAPTER_DNS_SERVER_ADDRESS;
185typedef struct _IP_ADAPTER_PREFIX {
186 _ANONYMOUS_UNION union {
187 ULONGLONG Alignment;
188 _ANONYMOUS_STRUCT struct {
189 ULONG Length;
190 DWORD Flags;
191 } DUMMYSTRUCTNAME;
192 } DUMMYUNIONNAME;
193 struct _IP_ADAPTER_PREFIX* Next;
194 SOCKET_ADDRESS Address;
195 ULONG PrefixLength;
196} IP_ADAPTER_PREFIX,*PIP_ADAPTER_PREFIX;
197typedef struct _IP_ADAPTER_ADDRESSES {
198 _ANONYMOUS_UNION union {
199 ULONGLONG Alignment;
200 _ANONYMOUS_STRUCT struct {
201 ULONG Length;
202 DWORD IfIndex;
203 } DUMMYSTRUCTNAME;
204 } DUMMYUNIONNAME;
205 struct _IP_ADAPTER_ADDRESSES* Next;
206 PCHAR AdapterName;
207 PIP_ADAPTER_UNICAST_ADDRESS FirstUnicastAddress;
208 PIP_ADAPTER_ANYCAST_ADDRESS FirstAnycastAddress;
209 PIP_ADAPTER_MULTICAST_ADDRESS FirstMulticastAddress;
210 PIP_ADAPTER_DNS_SERVER_ADDRESS FirstDnsServerAddress;
211 PWCHAR DnsSuffix;
212 PWCHAR Description;
213 PWCHAR FriendlyName;
214 BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH];
215 DWORD PhysicalAddressLength;
216 DWORD Flags;
217 DWORD Mtu;
218 DWORD IfType;
219 IF_OPER_STATUS OperStatus;
220 DWORD Ipv6IfIndex;
221 DWORD ZoneIndices[16];
222 PIP_ADAPTER_PREFIX FirstPrefix;
223} IP_ADAPTER_ADDRESSES,*PIP_ADAPTER_ADDRESSES;
224#endif
225
226#ifdef __cplusplus
227}
228#endif
229#endif /* _IPTYPES_H */
Note: See TracBrowser for help on using the repository browser.