include: Fix some winsock definitions.
[wine] / include / iptypes.h
1 /* WINE iptypes.h
2  * Copyright (C) 2003 Juan Lang
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18
19 #ifndef WINE_IPTYPES_H_
20 #define WINE_IPTYPES_H_
21
22 #include <time.h>
23 #include <ifdef.h>
24 #include <nldef.h>
25
26 #define MAX_ADAPTER_DESCRIPTION_LENGTH  128
27 #define MAX_ADAPTER_NAME_LENGTH         256
28 #define MAX_ADAPTER_ADDRESS_LENGTH      8
29 #define MAX_HOSTNAME_LEN                128
30 #define MAX_DOMAIN_NAME_LEN             128
31 #define MAX_SCOPE_ID_LEN                256
32 #define MAX_DHCPV6_DUID_LENGTH          130
33 #define MAX_DNS_SUFFIX_STRING_LENGTH    256
34
35 #define BROADCAST_NODETYPE              1
36 #define PEER_TO_PEER_NODETYPE           2
37 #define MIXED_NODETYPE                  4
38 #define HYBRID_NODETYPE                 8
39
40 typedef struct {
41     char String[4 * 4];
42 } IP_ADDRESS_STRING, *PIP_ADDRESS_STRING, IP_MASK_STRING, *PIP_MASK_STRING;
43
44 typedef struct _IP_ADDR_STRING {
45     struct _IP_ADDR_STRING* Next;
46     IP_ADDRESS_STRING IpAddress;
47     IP_MASK_STRING IpMask;
48     DWORD Context;
49 } IP_ADDR_STRING, *PIP_ADDR_STRING;
50
51 typedef struct _IP_ADAPTER_INFO {
52     struct _IP_ADAPTER_INFO* Next;
53     DWORD ComboIndex;
54     char AdapterName[MAX_ADAPTER_NAME_LENGTH + 4];
55     char Description[MAX_ADAPTER_DESCRIPTION_LENGTH + 4];
56     UINT AddressLength;
57     BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH];
58     DWORD Index;
59     UINT Type;
60     UINT DhcpEnabled;
61     PIP_ADDR_STRING CurrentIpAddress;
62     IP_ADDR_STRING IpAddressList;
63     IP_ADDR_STRING GatewayList;
64     IP_ADDR_STRING DhcpServer;
65     BOOL HaveWins;
66     IP_ADDR_STRING PrimaryWinsServer;
67     IP_ADDR_STRING SecondaryWinsServer;
68     time_t LeaseObtained;
69     time_t LeaseExpires;
70 } IP_ADAPTER_INFO, *PIP_ADAPTER_INFO;
71
72 typedef struct _IP_PER_ADAPTER_INFO {
73     UINT AutoconfigEnabled;
74     UINT AutoconfigActive;
75     PIP_ADDR_STRING CurrentDnsServer;
76     IP_ADDR_STRING DnsServerList;
77 } IP_PER_ADAPTER_INFO, *PIP_PER_ADAPTER_INFO;
78
79 typedef struct {
80     char HostName[MAX_HOSTNAME_LEN + 4] ;
81     char DomainName[MAX_DOMAIN_NAME_LEN + 4];
82     PIP_ADDR_STRING CurrentDnsServer;
83     IP_ADDR_STRING DnsServerList;
84     UINT NodeType;
85     char ScopeId[MAX_SCOPE_ID_LEN + 4];
86     UINT EnableRouting;
87     UINT EnableProxy;
88     UINT EnableDns;
89 } FIXED_INFO, *PFIXED_INFO;
90
91 typedef NL_PREFIX_ORIGIN IP_PREFIX_ORIGIN;
92 typedef NL_SUFFIX_ORIGIN IP_SUFFIX_ORIGIN;
93 typedef NL_DAD_STATE IP_DAD_STATE;
94
95 #ifdef _WINSOCK2API_
96
97 typedef struct _IP_ADAPTER_UNICAST_ADDRESS {
98     union {
99         struct {
100             ULONG Length;
101             DWORD Flags;
102         } DUMMYSTRUCTNAME;
103     } DUMMYUNIONNAME;
104     struct _IP_ADAPTER_UNICAST_ADDRESS *Next;
105     SOCKET_ADDRESS                      Address;
106     IP_PREFIX_ORIGIN                    PrefixOrigin;
107     IP_SUFFIX_ORIGIN                    SuffixOrigin;
108     IP_DAD_STATE                        DadState;
109     ULONG                               ValidLifetime;
110     ULONG                               PreferredLifetime;
111     ULONG                               LeaseLifetime;
112 } IP_ADAPTER_UNICAST_ADDRESS, *PIP_ADAPTER_UNICAST_ADDRESS;
113
114 typedef struct _IP_ADAPTER_ANYCAST_ADDRESS {
115     union {
116         ULONGLONG Alignment;
117         struct {
118             ULONG Length;
119             DWORD Flags;
120         } DUMMYSTRUCTNAME;
121     } DUMMYUNIONNAME;
122     struct _IP_ADAPTER_ANYCAST_ADDRESS *Next;
123     SOCKET_ADDRESS                      Address;
124 } IP_ADAPTER_ANYCAST_ADDRESS, *PIP_ADAPTER_ANYCAST_ADDRESS;
125
126 typedef struct _IP_ADAPTER_MULTICAST_ADDRESS {
127     union {
128         ULONGLONG Alignment;
129         struct {
130             ULONG Length;
131             DWORD Flags;
132         } DUMMYSTRUCTNAME;
133     } DUMMYUNIONNAME;
134     struct _IP_ADAPTER_MULTICAST_ADDRESS *Next;
135     SOCKET_ADDRESS                       Address;
136 } IP_ADAPTER_MULTICAST_ADDRESS, *PIP_ADAPTER_MULTICAST_ADDRESS;
137
138 typedef struct _IP_ADAPTER_DNS_SERVER_ADDRESS {
139     union {
140         ULONGLONG Alignment;
141         struct {
142             ULONG Length;
143             DWORD Reserved;
144         } DUMMYSTRUCTNAME;
145     } DUMMYUNIONNAME;
146     struct _IP_ADAPTER_DNS_SERVER_ADDRESS *Next;
147     SOCKET_ADDRESS                         Address;
148 } IP_ADAPTER_DNS_SERVER_ADDRESS, *PIP_ADAPTER_DNS_SERVER_ADDRESS;
149
150 typedef struct _IP_ADAPTER_PREFIX {
151     union {
152         ULONGLONG Alignment;
153         struct {
154             ULONG Length;
155             DWORD Flags;
156         } DUMMYSTRUCTNAME;
157     } DUMMYUNIONNAME;
158     struct _IP_ADAPTER_PREFIX *Next;
159     SOCKET_ADDRESS             Address;
160     ULONG                      PrefixLength;
161 } IP_ADAPTER_PREFIX, *PIP_ADAPTER_PREFIX;
162
163 typedef struct _IP_ADAPTER_WINS_SERVER_ADDRESS_LH {
164     union {
165         ULONGLONG Alignment;
166         struct {
167             ULONG Length;
168             DWORD Reserved;
169         } DUMMYSTRUCTNAME;
170     } DUMMYUNIONNAME;
171     struct _IP_ADAPTER_WINS_SERVER_ADDRESS_LH *Next;
172     SOCKET_ADDRESS Address;
173 } IP_ADAPTER_WINS_SERVER_ADDRESS_LH, *PIP_ADAPTER_WINS_SERVER_ADDRESS_LH;
174 typedef IP_ADAPTER_WINS_SERVER_ADDRESS_LH IP_ADAPTER_WINS_SERVER_ADDRESS;
175 typedef IP_ADAPTER_WINS_SERVER_ADDRESS_LH *PIP_ADAPTER_WINS_SERVER_ADDRESS;
176
177 typedef struct _IP_ADAPTER_GATEWAY_ADDRESS_LH {
178     union {
179         ULONGLONG Alignment;
180         struct {
181             ULONG Length;
182             DWORD Reserved;
183         } DUMMYSTRUCTNAME;
184     } DUMMYUNIONNAME;
185     struct _IP_ADAPTER_GATEWAY_ADDRESS_LH *Next;
186     SOCKET_ADDRESS Address;
187 } IP_ADAPTER_GATEWAY_ADDRESS_LH, *PIP_ADAPTER_GATEWAY_ADDRESS_LH;
188 typedef IP_ADAPTER_GATEWAY_ADDRESS_LH IP_ADAPTER_GATEWAY_ADDRESS;
189 typedef IP_ADAPTER_GATEWAY_ADDRESS_LH *PIP_ADAPTER_GATEWAY_ADDRESS;
190
191 #define IP_ADAPTER_DDNS_ENABLED               0x1
192 #define IP_ADAPTER_REGISTER_ADAPTER_SUFFIX    0x2
193 #define IP_ADAPTER_DHCP_ENABLED               0x4
194 #define IP_ADAPTER_RECEIVE_ONLY               0x8
195 #define IP_ADAPTER_NO_MULTICAST               0x10
196 #define IP_ADAPTER_IPV6_OTHER_STATEFUL_CONFIG 0x20
197 #define IP_ADAPTER_NETBIOS_OVER_TCPIP_ENABLED 0x40
198 #define IP_ADAPTER_IPV4_ENABLED               0x80
199 #define IP_ADAPTER_IPV6_ENABLED               0x100
200 #define IP_ADAPTER_IPV6_MANAGE_ADDRESS_CONFIG 0x200
201
202 typedef struct _IP_ADAPTER_ADDRESSES {
203     union {
204         ULONGLONG Alignment;
205         struct {
206             ULONG Length;
207             DWORD IfIndex;
208         } DUMMYSTRUCTNAME;
209     } DUMMYUNIONNAME;
210     struct _IP_ADAPTER_ADDRESSES   *Next;
211     PCHAR                           AdapterName;
212     PIP_ADAPTER_UNICAST_ADDRESS     FirstUnicastAddress;
213     PIP_ADAPTER_ANYCAST_ADDRESS     FirstAnycastAddress;
214     PIP_ADAPTER_MULTICAST_ADDRESS   FirstMulticastAddress;
215     PIP_ADAPTER_DNS_SERVER_ADDRESS  FirstDnsServerAddress;
216     PWCHAR                          DnsSuffix;
217     PWCHAR                          Description;
218     PWCHAR                          FriendlyName;
219     BYTE                            PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH];
220     DWORD                           PhysicalAddressLength;
221     DWORD                           Flags;
222     DWORD                           Mtu;
223     DWORD                           IfType;
224     IF_OPER_STATUS                  OperStatus;
225     DWORD                           Ipv6IfIndex;
226     DWORD                           ZoneIndices[16];
227     PIP_ADAPTER_PREFIX              FirstPrefix;
228     ULONG64                         TransmitLinkSpeed;
229     ULONG64                         ReceiveLinkSpeed;
230     PIP_ADAPTER_WINS_SERVER_ADDRESS_LH FirstWinsServerAddress;
231     PIP_ADAPTER_GATEWAY_ADDRESS_LH  FirstGatewayAddress;
232     ULONG                           Ipv4Metric;
233     ULONG                           Ipv6Metric;
234     IF_LUID                         Luid;
235     SOCKET_ADDRESS                  Dhcpv4Server;
236     NET_IF_COMPARTMENT_ID           CompartmentId;
237     NET_IF_NETWORK_GUID             NetworkGuid;
238     NET_IF_CONNECTION_TYPE          ConnectionType;
239     TUNNEL_TYPE                     TunnelType;
240     SOCKET_ADDRESS                  Dhcpv6Server;
241     BYTE                            Dhcpv6ClientDuid[MAX_DHCPV6_DUID_LENGTH];
242     ULONG                           Dhcpv6ClientDuidLength;
243     ULONG                           Dhcpv6Iaid;
244 } IP_ADAPTER_ADDRESSES, *PIP_ADAPTER_ADDRESSES;
245
246 #define GAA_FLAG_SKIP_UNICAST                0x00000001
247 #define GAA_FLAG_SKIP_ANYCAST                0x00000002
248 #define GAA_FLAG_SKIP_MULTICAST              0x00000004
249 #define GAA_FLAG_SKIP_DNS_SERVER             0x00000008
250 #define GAA_FLAG_INCLUDE_PREFIX              0x00000010
251 #define GAA_FLAG_SKIP_FRIENDLY_NAME          0x00000020
252 #define GAA_FLAG_INCLUDE_WINS_INFO           0x00000040
253 #define GAA_FLAG_INCLUDE_ALL_GATEWAYS        0x00000080
254 #define GAA_FLAG_INCLUDE_ALL_INTERFACES      0x00000100
255 #define GAA_FLAG_INCLUDE_ALL_COMPARTMENTS    0x00000200
256 #define GAA_FLAG_INCLUDE_TUNNEL_BINDINGORDER 0x00000400
257
258 #endif /* _WINSOCK2API_ */
259
260 #endif /* WINE_IPTYPES_H_*/