Sync with trunk (r48545)
[reactos.git] / include / psdk / iptypes.h
1 #ifndef _IPTYPES_H
2 #define _IPTYPES_H
3
4 #include <sys/types.h>
5 #include <ifdef.h>
6
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 #define DEFAULT_MINIMUM_ENTITIES 32
11 #define MAX_ADAPTER_ADDRESS_LENGTH 8
12 #define MAX_ADAPTER_DESCRIPTION_LENGTH 128
13 #define MAX_ADAPTER_NAME_LENGTH 256
14 #define MAX_DOMAIN_NAME_LEN 128
15 #define MAX_HOSTNAME_LEN 128
16 #define MAX_SCOPE_ID_LEN 256
17 #define BROADCAST_NODETYPE 1
18 #define PEER_TO_PEER_NODETYPE 2
19 #define MIXED_NODETYPE 4
20 #define HYBRID_NODETYPE 8
21 #define IF_OTHER_ADAPTERTYPE 0
22 #define IF_ETHERNET_ADAPTERTYPE 1
23 #define IF_TOKEN_RING_ADAPTERTYPE 2
24 #define IF_FDDI_ADAPTERTYPE 3
25 #define IF_PPP_ADAPTERTYPE 4
26 #define IF_LOOPBACK_ADAPTERTYPE 5
27 typedef struct {
28 char String[16];
29 } IP_ADDRESS_STRING, *PIP_ADDRESS_STRING, IP_MASK_STRING, *PIP_MASK_STRING;
30 typedef struct _IP_ADDR_STRING {
31 struct _IP_ADDR_STRING* Next;
32 IP_ADDRESS_STRING IpAddress;
33 IP_MASK_STRING IpMask;
34 DWORD Context;
35 } IP_ADDR_STRING, *PIP_ADDR_STRING;
36 typedef struct _IP_ADAPTER_INFO {
37 struct _IP_ADAPTER_INFO* Next;
38 DWORD ComboIndex;
39 char AdapterName[MAX_ADAPTER_NAME_LENGTH+4];
40 char Description[MAX_ADAPTER_DESCRIPTION_LENGTH+4];
41 UINT AddressLength;
42 BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH];
43 DWORD Index;
44 UINT Type;
45 UINT DhcpEnabled;
46 PIP_ADDR_STRING CurrentIpAddress;
47 IP_ADDR_STRING IpAddressList;
48 IP_ADDR_STRING GatewayList;
49 IP_ADDR_STRING DhcpServer;
50 BOOL HaveWins;
51 IP_ADDR_STRING PrimaryWinsServer;
52 IP_ADDR_STRING SecondaryWinsServer;
53 time_t LeaseObtained;
54 time_t LeaseExpires;
55 } IP_ADAPTER_INFO, *PIP_ADAPTER_INFO;
56 typedef struct _IP_PER_ADAPTER_INFO {
57 UINT AutoconfigEnabled;
58 UINT AutoconfigActive;
59 PIP_ADDR_STRING CurrentDnsServer;
60 IP_ADDR_STRING DnsServerList;
61 } IP_PER_ADAPTER_INFO, *PIP_PER_ADAPTER_INFO;
62 typedef struct {
63 ULONG Index;
64 ULONG MediaType;
65 UCHAR ConnectionType;
66 UCHAR AccessType;
67 GUID DeviceGuid;
68 GUID InterfaceGuid;
69 } IP_INTERFACE_NAME_INFO, *PIP_INTERFACE_NAME_INFO;
70 typedef struct _FIXED_INFO {
71 char HostName[MAX_HOSTNAME_LEN+4] ;
72 char DomainName[MAX_DOMAIN_NAME_LEN+4];
73 PIP_ADDR_STRING CurrentDnsServer;
74 IP_ADDR_STRING DnsServerList;
75 UINT NodeType;
76 char ScopeId[MAX_SCOPE_ID_LEN+4];
77 UINT EnableRouting;
78 UINT EnableProxy;
79 UINT EnableDns;
80 } FIXED_INFO, *PFIXED_INFO;
81 #ifdef _WINSOCK2API_
82 typedef enum {
83 IpPrefixOriginOther = 0,
84 IpPrefixOriginManual,
85 IpPrefixOriginWellKnown,
86 IpPrefixOriginDhcp,
87 IpPrefixOriginRouterAdvertisement,
88 } IP_PREFIX_ORIGIN;
89 typedef enum {
90 IpSuffixOriginOther = 0,
91 IpSuffixOriginManual,
92 IpSuffixOriginWellKnown,
93 IpSuffixOriginDhcp,
94 IpSuffixOriginLinkLayerAddress,
95 IpSuffixOriginRandom,
96 } IP_SUFFIX_ORIGIN;
97 typedef enum {
98 IpDadStateInvalid = 0,
99 IpDadStateTentative,
100 IpDadStateDuplicate,
101 IpDadStateDeprecated,
102 IpDadStatePreferred,
103 } IP_DAD_STATE;
104 typedef struct _IP_ADAPTER_UNICAST_ADDRESS {
105 union {
106 ULONGLONG Alignment;
107 struct {
108 ULONG Length;
109 DWORD Flags;
110 };
111 };
112 struct _IP_ADAPTER_UNICAST_ADDRESS *Next;
113 SOCKET_ADDRESS Address;
114 IP_PREFIX_ORIGIN PrefixOrigin;
115 IP_SUFFIX_ORIGIN SuffixOrigin;
116 IP_DAD_STATE DadState;
117 ULONG ValidLifetime;
118 ULONG PreferredLifetime;
119 ULONG LeaseLifetime;
120 } IP_ADAPTER_UNICAST_ADDRESS, *PIP_ADAPTER_UNICAST_ADDRESS;
121 typedef struct _IP_ADAPTER_ANYCAST_ADDRESS {
122 union {
123 ULONGLONG Alignment;
124 struct {
125 ULONG Length;
126 DWORD Flags;
127 };
128 };
129 struct _IP_ADAPTER_ANYCAST_ADDRESS *Next;
130 SOCKET_ADDRESS Address;
131 } IP_ADAPTER_ANYCAST_ADDRESS, *PIP_ADAPTER_ANYCAST_ADDRESS;
132 typedef struct _IP_ADAPTER_MULTICAST_ADDRESS {
133 union {
134 ULONGLONG Alignment;
135 struct {
136 ULONG Length;
137 DWORD Flags;
138 };
139 };
140 struct _IP_ADAPTER_MULTICAST_ADDRESS *Next;
141 SOCKET_ADDRESS Address;
142 } IP_ADAPTER_MULTICAST_ADDRESS, *PIP_ADAPTER_MULTICAST_ADDRESS;
143 typedef struct _IP_ADAPTER_DNS_SERVER_ADDRESS {
144 union {
145 ULONGLONG Alignment;
146 struct {
147 ULONG Length;
148 DWORD Reserved;
149 };
150 };
151 struct _IP_ADAPTER_DNS_SERVER_ADDRESS *Next;
152 SOCKET_ADDRESS Address;
153 } IP_ADAPTER_DNS_SERVER_ADDRESS, *PIP_ADAPTER_DNS_SERVER_ADDRESS;
154 typedef struct _IP_ADAPTER_PREFIX {
155 union {
156 ULONGLONG Alignment;
157 struct {
158 ULONG Length;
159 DWORD Flags;
160 };
161 };
162 struct _IP_ADAPTER_PREFIX *Next;
163 SOCKET_ADDRESS Address;
164 ULONG PrefixLength;
165 } IP_ADAPTER_PREFIX, *PIP_ADAPTER_PREFIX;
166 typedef struct _IP_ADAPTER_ADDRESSES {
167 union {
168 ULONGLONG Alignment;
169 struct {
170 ULONG Length;
171 DWORD IfIndex;
172 };
173 };
174 struct _IP_ADAPTER_ADDRESSES *Next;
175 PCHAR AdapterName;
176 PIP_ADAPTER_UNICAST_ADDRESS FirstUnicastAddress;
177 PIP_ADAPTER_ANYCAST_ADDRESS FirstAnycastAddress;
178 PIP_ADAPTER_MULTICAST_ADDRESS FirstMulticastAddress;
179 PIP_ADAPTER_DNS_SERVER_ADDRESS FirstDnsServerAddress;
180 PWCHAR DnsSuffix;
181 PWCHAR Description;
182 PWCHAR FriendlyName;
183 BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH];
184 DWORD PhysicalAddressLength;
185 DWORD Flags;
186 DWORD Mtu;
187 DWORD IfType;
188 IF_OPER_STATUS OperStatus;
189 DWORD Ipv6IfIndex;
190 DWORD ZoneIndices[16];
191 PIP_ADAPTER_PREFIX FirstPrefix;
192 } IP_ADAPTER_ADDRESSES, *PIP_ADAPTER_ADDRESSES;
193 #endif
194
195 #ifdef __cplusplus
196 }
197 #endif
198 #endif /* _IPTYPES_H */