vcomp: Implement 32-bit atomic integer functions.
[wine.git] / include / ws2ipdef.h
blobca47caaab2338967d6a80f66ef486935573ffa96
1 /*
2 * Copyright (C) 2009 Robert Shearman
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.
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.
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
19 #ifndef __WS2IPDEF__
20 #define __WS2IPDEF__
22 #include <in6addr.h>
24 #ifdef USE_WS_PREFIX
25 #define WS(x) WS_##x
26 #else
27 #define WS(x) x
28 #endif
30 typedef struct WS(sockaddr_in6_old)
32 SHORT sin6_family;
33 USHORT sin6_port;
34 ULONG sin6_flowinfo;
35 IN6_ADDR sin6_addr;
36 } SOCKADDR_IN6_OLD,*PSOCKADDR_IN6_OLD, *LPSOCKADDR_IN6_OLD;
38 typedef union sockaddr_gen
40 struct WS(sockaddr) Address;
41 struct WS(sockaddr_in) AddressIn;
42 struct WS(sockaddr_in6_old) AddressIn6;
43 } WS(sockaddr_gen);
45 /* Structure to keep interface specific information */
46 typedef struct _INTERFACE_INFO
48 ULONG iiFlags; /* Interface flags */
49 WS(sockaddr_gen) iiAddress; /* Interface address */
50 WS(sockaddr_gen) iiBroadcastAddress; /* Broadcast address */
51 WS(sockaddr_gen) iiNetmask; /* Network mask */
52 } INTERFACE_INFO, * LPINTERFACE_INFO;
54 /* Possible flags for the iiFlags - bitmask */
55 #ifndef USE_WS_PREFIX
56 #define IFF_UP 0x00000001 /* Interface is up */
57 #define IFF_BROADCAST 0x00000002 /* Broadcast is supported */
58 #define IFF_LOOPBACK 0x00000004 /* this is loopback interface */
59 #define IFF_POINTTOPOINT 0x00000008 /* this is point-to-point interface */
60 #define IFF_MULTICAST 0x00000010 /* multicast is supported */
61 #else
62 #define WS_IFF_UP 0x00000001 /* Interface is up */
63 #define WS_IFF_BROADCAST 0x00000002 /* Broadcast is supported */
64 #define WS_IFF_LOOPBACK 0x00000004 /* this is loopback interface */
65 #define WS_IFF_POINTTOPOINT 0x00000008 /* this is point-to-point interface */
66 #define WS_IFF_MULTICAST 0x00000010 /* multicast is supported */
67 #endif /* USE_WS_PREFIX */
69 #ifndef USE_WS_PREFIX
70 #define IP_OPTIONS 1
71 #define IP_HDRINCL 2
72 #define IP_TOS 3
73 #define IP_TTL 4
74 #define IP_MULTICAST_IF 9
75 #define IP_MULTICAST_TTL 10
76 #define IP_MULTICAST_LOOP 11
77 #define IP_ADD_MEMBERSHIP 12
78 #define IP_DROP_MEMBERSHIP 13
79 #define IP_DONTFRAGMENT 14
80 #define IP_ADD_SOURCE_MEMBERSHIP 15
81 #define IP_DROP_SOURCE_MEMBERSHIP 16
82 #define IP_BLOCK_SOURCE 17
83 #define IP_UNBLOCK_SOURCE 18
84 #define IP_PKTINFO 19
85 #define IP_HOPLIMIT 21
86 #define IP_RECEIVE_BROADCAST 22
87 #define IP_RECVIF 24
88 #define IP_RECVDSTADDR 25
89 #define IP_IFLIST 28
90 #define IP_ADD_IFLIST 29
91 #define IP_DEL_IFLIST 30
92 #define IP_UNICAST_IF 31
93 #define IP_RTHDR 32
94 #define IP_RECVRTHDR 38
95 #else
96 #define WS_IP_OPTIONS 1
97 #define WS_IP_HDRINCL 2
98 #define WS_IP_TOS 3
99 #define WS_IP_TTL 4
100 #define WS_IP_MULTICAST_IF 9
101 #define WS_IP_MULTICAST_TTL 10
102 #define WS_IP_MULTICAST_LOOP 11
103 #define WS_IP_ADD_MEMBERSHIP 12
104 #define WS_IP_DROP_MEMBERSHIP 13
105 #define WS_IP_DONTFRAGMENT 14
106 #define WS_IP_ADD_SOURCE_MEMBERSHIP 15
107 #define WS_IP_DROP_SOURCE_MEMBERSHIP 16
108 #define WS_IP_BLOCK_SOURCE 17
109 #define WS_IP_UNBLOCK_SOURCE 18
110 #define WS_IP_PKTINFO 19
111 #define WS_IP_HOPLIMIT 21
112 #define WS_IP_RECEIVE_BROADCAST 22
113 #define WS_IP_RECVIF 24
114 #define WS_IP_RECVDSTADDR 25
115 #define WS_IP_IFLIST 28
116 #define WS_IP_ADD_IFLIST 29
117 #define WS_IP_DEL_IFLIST 30
118 #define WS_IP_UNICAST_IF 31
119 #define WS_IP_RTHDR 32
120 #define WS_IP_RECVRTHDR 38
121 #endif /* USE_WS_PREFIX */
123 typedef struct WS(sockaddr_in6)
125 SHORT sin6_family;
126 USHORT sin6_port;
127 ULONG sin6_flowinfo;
128 IN6_ADDR sin6_addr;
129 ULONG sin6_scope_id;
130 } SOCKADDR_IN6,*PSOCKADDR_IN6, *LPSOCKADDR_IN6;
132 typedef struct WS(sockaddr_in6_pair)
134 PSOCKADDR_IN6 SourceAddress;
135 PSOCKADDR_IN6 DestinationAddress;
136 } SOCKADDR_IN6_PAIR, *PSOCKADDR_IN6_PAIR;
139 * Multicast group information
142 typedef struct WS(ip_mreq)
144 struct WS(in_addr) imr_multiaddr;
145 struct WS(in_addr) imr_interface;
146 } WS(IP_MREQ), *WS(PIP_MREQ);
148 typedef struct WS(ip_mreq_source) {
149 struct WS(in_addr) imr_multiaddr;
150 struct WS(in_addr) imr_sourceaddr;
151 struct WS(in_addr) imr_interface;
152 } WS(IP_MREQ_SOURCE), *WS(PIP_MREQ_SOURCE);
154 typedef struct WS(ip_msfilter) {
155 struct WS(in_addr) imsf_multiaddr;
156 struct WS(in_addr) imsf_interface;
157 ULONG imsf_fmode;
158 ULONG imsf_numsrc;
159 struct WS(in_addr) imsf_slist[1];
160 } WS(IP_MSFILTER), *WS(PIP_MSFILTER);
162 typedef struct WS(in_pktinfo) {
163 IN_ADDR ipi_addr;
164 UINT ipi_ifindex;
165 } IN_PKTINFO, *PIN_PKTINFO;
167 #ifndef USE_WS_PREFIX
168 #define IPV6_OPTIONS 1
169 #define IPV6_HDRINCL 2
170 #define IPV6_UNICAST_HOPS 4
171 #define IPV6_MULTICAST_IF 9
172 #define IPV6_MULTICAST_HOPS 10
173 #define IPV6_MULTICAST_LOOP 11
174 #define IPV6_ADD_MEMBERSHIP 12
175 #define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP
176 #define IPV6_DROP_MEMBERSHIP 13
177 #define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP
178 #define IPV6_DONTFRAG 14
179 #define IPV6_PKTINFO 19
180 #define IPV6_HOPLIMIT 21
181 #define IPV6_PROTECTION_LEVEL 23
182 #define IPV6_RECVIF 24
183 #define IPV6_RECVDSTADDR 25
184 #define IPV6_CHECKSUM 26
185 #define IPV6_V6ONLY 27
186 #define IPV6_IFLIST 28
187 #define IPV6_ADD_IFLIST 29
188 #define IPV6_DEL_IFLIST 30
189 #define IPV6_UNICAST_IF 31
190 #define IPV6_RTHDR 32
191 #define IPV6_RECVRTHDR 38
192 #else
193 #define WS_IPV6_OPTIONS 1
194 #define WS_IPV6_HDRINCL 2
195 #define WS_IPV6_UNICAST_HOPS 4
196 #define WS_IPV6_MULTICAST_IF 9
197 #define WS_IPV6_MULTICAST_HOPS 10
198 #define WS_IPV6_MULTICAST_LOOP 11
199 #define WS_IPV6_ADD_MEMBERSHIP 12
200 #define WS_IPV6_DROP_MEMBERSHIP 13
201 #define WS_IPV6_LEAVE_GROUP WS_IPV6_DROP_MEMBERSHIP
202 #define WS_IPV6_DONTFRAG 14
203 #define WS_IPV6_PKTINFO 19
204 #define WS_IPV6_HOPLIMIT 21
205 #define WS_IPV6_PROTECTION_LEVEL 23
206 #define WS_IPV6_RECVIF 24
207 #define WS_IPV6_RECVDSTADDR 25
208 #define WS_IPV6_CHECKSUM 26
209 #define WS_IPV6_V6ONLY 27
210 #define WS_IPV6_IFLIST 28
211 #define WS_IPV6_ADD_IFLIST 29
212 #define WS_IPV6_DEL_IFLIST 30
213 #define WS_IPV6_UNICAST_IF 31
214 #define WS_IPV6_RTHDR 32
215 #define WS_IPV6_RECVRTHDR 38
216 #endif /* USE_WS_PREFIX */
218 #ifndef USE_WS_PREFIX
219 #define TCP_OFFLOAD_NO_PREFERENCE 0
220 #define TCP_OFFLOAD_NOT_PREFERRED 1
221 #define TCP_OFFLOAD_PREFERRED 2
222 #else
223 #define WS_TCP_OFFLOAD_NO_PREFERENCE 0
224 #define WS_TCP_OFFLOAD_NOT_PREFERRED 1
225 #define WS_TCP_OFFLOAD_PREFERRED 2
226 #endif /* USE_WS_PREFIX */
228 #ifndef USE_WS_PREFIX
229 /* TCP_NODELAY is defined elsewhere */
230 #define TCP_EXPEDITED_1122 2
231 #define TCP_KEEPALIVE 3
232 #define TCP_MAXSEG 4
233 #define TCP_MAXRT 5
234 #define TCP_STDURG 6
235 #define TCP_NOURG 7
236 #define TCP_ATMARK 8
237 #define TCP_NOSYNRETRIES 9
238 #define TCP_TIMESTAMPS 10
239 #define TCP_OFFLOAD_PREFERENCE 11
240 #define TCP_CONGESTION_ALGORITHM 12
241 #define TCP_DELAY_FIN_ACK 13
242 #else
243 /* WS_TCP_NODELAY is defined elsewhere */
244 #define WS_TCP_EXPEDITED_1122 2
245 #define WS_TCP_KEEPALIVE 3
246 #define WS_TCP_MAXSEG 4
247 #define WS_TCP_MAXRT 5
248 #define WS_TCP_STDURG 6
249 #define WS_TCP_NOURG 7
250 #define WS_TCP_ATMARK 8
251 #define WS_TCP_NOSYNRETRIES 9
252 #define WS_TCP_TIMESTAMPS 10
253 #define WS_TCP_OFFLOAD_PREFERENCE 11
254 #define WS_TCP_CONGESTION_ALGORITHM 12
255 #define WS_TCP_DELAY_FIN_ACK 13
256 #endif /* USE_WS_PREFIX */
258 #ifndef USE_WS_PREFIX
259 #define INET_ADDRSTRLEN 22
260 #define INET6_ADDRSTRLEN 65
261 #define IN6ADDR_ANY_INIT { 0 }
262 #define IN6ADDR_LOOPBACK_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }
263 #else
264 #define WS_INET_ADDRSTRLEN 22
265 #define WS_INET6_ADDRSTRLEN 65
266 #define WS_IN6ADDR_ANY_INIT { 0 }
267 #define WS_IN6ADDR_LOOPBACK_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }
268 #endif /* USE_WS_PREFIX */
270 #ifdef __cplusplus
271 extern "C" {
272 #endif
274 static inline BOOL WS(IN6_IS_ADDR_LOOPBACK) ( const IN6_ADDR *a )
276 return (BOOL)((a->s6_words[0] == 0) &&
277 (a->s6_words[1] == 0) &&
278 (a->s6_words[2] == 0) &&
279 (a->s6_words[3] == 0) &&
280 (a->s6_words[4] == 0) &&
281 (a->s6_words[5] == 0) &&
282 (a->s6_words[6] == 0) &&
283 (a->s6_words[7] == 0x0100));
286 #ifdef __cplusplus
288 #endif
290 #endif /* __WS2IPDEF__ */