1 | // |
2 | // detail/socket_types.hpp |
3 | // ~~~~~~~~~~~~~~~~~~~~~~~ |
4 | // |
5 | // Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) |
6 | // |
7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying |
8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
9 | // |
10 | |
11 | #ifndef BOOST_ASIO_DETAIL_SOCKET_TYPES_HPP |
12 | #define BOOST_ASIO_DETAIL_SOCKET_TYPES_HPP |
13 | |
14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) |
15 | # pragma once |
16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) |
17 | |
18 | #include <boost/asio/detail/config.hpp> |
19 | |
20 | #if defined(BOOST_ASIO_WINDOWS_RUNTIME) |
21 | // Empty. |
22 | #elif defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) |
23 | # if defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_) |
24 | # error WinSock.h has already been included |
25 | # endif // defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_) |
26 | # if defined(__BORLANDC__) |
27 | # include <stdlib.h> // Needed for __errno |
28 | # if !defined(_WSPIAPI_H_) |
29 | # define _WSPIAPI_H_ |
30 | # define BOOST_ASIO_WSPIAPI_H_DEFINED |
31 | # endif // !defined(_WSPIAPI_H_) |
32 | # endif // defined(__BORLANDC__) |
33 | # include <winsock2.h> |
34 | # include <ws2tcpip.h> |
35 | # if defined(WINAPI_FAMILY) |
36 | # if ((WINAPI_FAMILY & WINAPI_PARTITION_DESKTOP) != 0) |
37 | # include <windows.h> |
38 | # endif // ((WINAPI_FAMILY & WINAPI_PARTITION_DESKTOP) != 0) |
39 | # endif // defined(WINAPI_FAMILY) |
40 | # if !defined(BOOST_ASIO_WINDOWS_APP) |
41 | # include <mswsock.h> |
42 | # endif // !defined(BOOST_ASIO_WINDOWS_APP) |
43 | # if defined(BOOST_ASIO_WSPIAPI_H_DEFINED) |
44 | # undef _WSPIAPI_H_ |
45 | # undef BOOST_ASIO_WSPIAPI_H_DEFINED |
46 | # endif // defined(BOOST_ASIO_WSPIAPI_H_DEFINED) |
47 | # if !defined(BOOST_ASIO_NO_DEFAULT_LINKED_LIBS) |
48 | # if defined(UNDER_CE) |
49 | # pragma comment(lib, "ws2.lib") |
50 | # elif defined(_MSC_VER) || defined(__BORLANDC__) |
51 | # pragma comment(lib, "ws2_32.lib") |
52 | # if !defined(BOOST_ASIO_WINDOWS_APP) |
53 | # pragma comment(lib, "mswsock.lib") |
54 | # endif // !defined(BOOST_ASIO_WINDOWS_APP) |
55 | # endif // defined(_MSC_VER) || defined(__BORLANDC__) |
56 | # endif // !defined(BOOST_ASIO_NO_DEFAULT_LINKED_LIBS) |
57 | # include <boost/asio/detail/old_win_sdk_compat.hpp> |
58 | #else |
59 | # include <sys/ioctl.h> |
60 | # if (defined(__MACH__) && defined(__APPLE__)) \ |
61 | || defined(__FreeBSD__) || defined(__NetBSD__) \ |
62 | || defined(__OpenBSD__) || defined(__linux__) \ |
63 | || defined(__EMSCRIPTEN__) |
64 | # include <poll.h> |
65 | # elif !defined(__SYMBIAN32__) |
66 | # include <sys/poll.h> |
67 | # endif |
68 | # include <sys/types.h> |
69 | # include <sys/stat.h> |
70 | # include <fcntl.h> |
71 | # if defined(__hpux) |
72 | # include <sys/time.h> |
73 | # endif |
74 | # if !defined(__hpux) || defined(__SELECT) |
75 | # include <sys/select.h> |
76 | # endif |
77 | # include <sys/socket.h> |
78 | # include <sys/uio.h> |
79 | # include <sys/un.h> |
80 | # include <netinet/in.h> |
81 | # if !defined(__SYMBIAN32__) |
82 | # include <netinet/tcp.h> |
83 | # endif |
84 | # include <arpa/inet.h> |
85 | # include <netdb.h> |
86 | # include <net/if.h> |
87 | # include <limits.h> |
88 | # if defined(__sun) |
89 | # include <sys/filio.h> |
90 | # include <sys/sockio.h> |
91 | # endif |
92 | # include <signal.h> |
93 | #endif |
94 | |
95 | #include <boost/asio/detail/push_options.hpp> |
96 | |
97 | namespace boost { |
98 | namespace asio { |
99 | namespace detail { |
100 | |
101 | #if defined(BOOST_ASIO_WINDOWS_RUNTIME) |
102 | const int max_addr_v4_str_len = 256; |
103 | const int max_addr_v6_str_len = 256; |
104 | typedef unsigned __int32 u_long_type; |
105 | typedef unsigned __int16 u_short_type; |
106 | struct in4_addr_type { u_long_type s_addr; }; |
107 | struct in4_mreq_type { in4_addr_type imr_multiaddr, imr_interface; }; |
108 | struct in6_addr_type { unsigned char s6_addr[16]; }; |
109 | struct in6_mreq_type { in6_addr_type ipv6mr_multiaddr; |
110 | unsigned long ipv6mr_interface; }; |
111 | struct socket_addr_type { int sa_family; }; |
112 | struct sockaddr_in4_type { int sin_family; |
113 | in4_addr_type sin_addr; u_short_type sin_port; }; |
114 | struct sockaddr_in6_type { int sin6_family; |
115 | in6_addr_type sin6_addr; u_short_type sin6_port; |
116 | u_long_type sin6_flowinfo; u_long_type sin6_scope_id; }; |
117 | struct sockaddr_storage_type { int ss_family; |
118 | unsigned char ss_bytes[128 - sizeof(int)]; }; |
119 | struct addrinfo_type { int ai_flags; |
120 | int ai_family, ai_socktype, ai_protocol; |
121 | int ai_addrlen; const void* ai_addr; |
122 | const char* ai_canonname; addrinfo_type* ai_next; }; |
123 | struct linger_type { u_short_type l_onoff, l_linger; }; |
124 | typedef u_long_type ioctl_arg_type; |
125 | typedef int signed_size_type; |
126 | # define BOOST_ASIO_OS_DEF(c) BOOST_ASIO_OS_DEF_##c |
127 | # define BOOST_ASIO_OS_DEF_AF_UNSPEC 0 |
128 | # define BOOST_ASIO_OS_DEF_AF_INET 2 |
129 | # define BOOST_ASIO_OS_DEF_AF_INET6 23 |
130 | # define BOOST_ASIO_OS_DEF_SOCK_STREAM 1 |
131 | # define BOOST_ASIO_OS_DEF_SOCK_DGRAM 2 |
132 | # define BOOST_ASIO_OS_DEF_SOCK_RAW 3 |
133 | # define BOOST_ASIO_OS_DEF_SOCK_SEQPACKET 5 |
134 | # define BOOST_ASIO_OS_DEF_IPPROTO_IP 0 |
135 | # define BOOST_ASIO_OS_DEF_IPPROTO_IPV6 41 |
136 | # define BOOST_ASIO_OS_DEF_IPPROTO_TCP 6 |
137 | # define BOOST_ASIO_OS_DEF_IPPROTO_UDP 17 |
138 | # define BOOST_ASIO_OS_DEF_IPPROTO_ICMP 1 |
139 | # define BOOST_ASIO_OS_DEF_IPPROTO_ICMPV6 58 |
140 | # define BOOST_ASIO_OS_DEF_FIONBIO 1 |
141 | # define BOOST_ASIO_OS_DEF_FIONREAD 2 |
142 | # define BOOST_ASIO_OS_DEF_INADDR_ANY 0 |
143 | # define BOOST_ASIO_OS_DEF_MSG_OOB 0x1 |
144 | # define BOOST_ASIO_OS_DEF_MSG_PEEK 0x2 |
145 | # define BOOST_ASIO_OS_DEF_MSG_DONTROUTE 0x4 |
146 | # define BOOST_ASIO_OS_DEF_MSG_EOR 0 // Not supported. |
147 | # define BOOST_ASIO_OS_DEF_SHUT_RD 0x0 |
148 | # define BOOST_ASIO_OS_DEF_SHUT_WR 0x1 |
149 | # define BOOST_ASIO_OS_DEF_SHUT_RDWR 0x2 |
150 | # define BOOST_ASIO_OS_DEF_SOMAXCONN 0x7fffffff |
151 | # define BOOST_ASIO_OS_DEF_SOL_SOCKET 0xffff |
152 | # define BOOST_ASIO_OS_DEF_SO_BROADCAST 0x20 |
153 | # define BOOST_ASIO_OS_DEF_SO_DEBUG 0x1 |
154 | # define BOOST_ASIO_OS_DEF_SO_DONTROUTE 0x10 |
155 | # define BOOST_ASIO_OS_DEF_SO_KEEPALIVE 0x8 |
156 | # define BOOST_ASIO_OS_DEF_SO_LINGER 0x80 |
157 | # define BOOST_ASIO_OS_DEF_SO_OOBINLINE 0x100 |
158 | # define BOOST_ASIO_OS_DEF_SO_SNDBUF 0x1001 |
159 | # define BOOST_ASIO_OS_DEF_SO_RCVBUF 0x1002 |
160 | # define BOOST_ASIO_OS_DEF_SO_SNDLOWAT 0x1003 |
161 | # define BOOST_ASIO_OS_DEF_SO_RCVLOWAT 0x1004 |
162 | # define BOOST_ASIO_OS_DEF_SO_REUSEADDR 0x4 |
163 | # define BOOST_ASIO_OS_DEF_TCP_NODELAY 0x1 |
164 | # define BOOST_ASIO_OS_DEF_IP_MULTICAST_IF 2 |
165 | # define BOOST_ASIO_OS_DEF_IP_MULTICAST_TTL 3 |
166 | # define BOOST_ASIO_OS_DEF_IP_MULTICAST_LOOP 4 |
167 | # define BOOST_ASIO_OS_DEF_IP_ADD_MEMBERSHIP 5 |
168 | # define BOOST_ASIO_OS_DEF_IP_DROP_MEMBERSHIP 6 |
169 | # define BOOST_ASIO_OS_DEF_IP_TTL 7 |
170 | # define BOOST_ASIO_OS_DEF_IPV6_UNICAST_HOPS 4 |
171 | # define BOOST_ASIO_OS_DEF_IPV6_MULTICAST_IF 9 |
172 | # define BOOST_ASIO_OS_DEF_IPV6_MULTICAST_HOPS 10 |
173 | # define BOOST_ASIO_OS_DEF_IPV6_MULTICAST_LOOP 11 |
174 | # define BOOST_ASIO_OS_DEF_IPV6_JOIN_GROUP 12 |
175 | # define BOOST_ASIO_OS_DEF_IPV6_LEAVE_GROUP 13 |
176 | # define BOOST_ASIO_OS_DEF_AI_CANONNAME 0x2 |
177 | # define BOOST_ASIO_OS_DEF_AI_PASSIVE 0x1 |
178 | # define BOOST_ASIO_OS_DEF_AI_NUMERICHOST 0x4 |
179 | # define BOOST_ASIO_OS_DEF_AI_NUMERICSERV 0x8 |
180 | # define BOOST_ASIO_OS_DEF_AI_V4MAPPED 0x800 |
181 | # define BOOST_ASIO_OS_DEF_AI_ALL 0x100 |
182 | # define BOOST_ASIO_OS_DEF_AI_ADDRCONFIG 0x400 |
183 | # define BOOST_ASIO_OS_DEF_SA_RESTART 0x1 |
184 | # define BOOST_ASIO_OS_DEF_SA_NOCLDSTOP 0x2 |
185 | # define BOOST_ASIO_OS_DEF_SA_NOCLDWAIT 0x4 |
186 | #elif defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) |
187 | typedef SOCKET socket_type; |
188 | const SOCKET invalid_socket = INVALID_SOCKET; |
189 | const int socket_error_retval = SOCKET_ERROR; |
190 | const int max_addr_v4_str_len = 256; |
191 | const int max_addr_v6_str_len = 256; |
192 | typedef sockaddr socket_addr_type; |
193 | typedef in_addr in4_addr_type; |
194 | typedef ip_mreq in4_mreq_type; |
195 | typedef sockaddr_in sockaddr_in4_type; |
196 | # if defined(BOOST_ASIO_HAS_OLD_WIN_SDK) |
197 | typedef in6_addr_emulation in6_addr_type; |
198 | typedef ipv6_mreq_emulation in6_mreq_type; |
199 | typedef sockaddr_in6_emulation sockaddr_in6_type; |
200 | typedef sockaddr_storage_emulation sockaddr_storage_type; |
201 | typedef addrinfo_emulation addrinfo_type; |
202 | # else |
203 | typedef in6_addr in6_addr_type; |
204 | typedef ipv6_mreq in6_mreq_type; |
205 | typedef sockaddr_in6 sockaddr_in6_type; |
206 | typedef sockaddr_storage sockaddr_storage_type; |
207 | typedef addrinfo addrinfo_type; |
208 | # endif |
209 | typedef ::linger linger_type; |
210 | typedef unsigned long ioctl_arg_type; |
211 | typedef u_long u_long_type; |
212 | typedef u_short u_short_type; |
213 | typedef int signed_size_type; |
214 | struct sockaddr_un_type { u_short sun_family; char sun_path[108]; }; |
215 | # define BOOST_ASIO_OS_DEF(c) BOOST_ASIO_OS_DEF_##c |
216 | # define BOOST_ASIO_OS_DEF_AF_UNSPEC AF_UNSPEC |
217 | # define BOOST_ASIO_OS_DEF_AF_INET AF_INET |
218 | # define BOOST_ASIO_OS_DEF_AF_INET6 AF_INET6 |
219 | # define BOOST_ASIO_OS_DEF_SOCK_STREAM SOCK_STREAM |
220 | # define BOOST_ASIO_OS_DEF_SOCK_DGRAM SOCK_DGRAM |
221 | # define BOOST_ASIO_OS_DEF_SOCK_RAW SOCK_RAW |
222 | # define BOOST_ASIO_OS_DEF_SOCK_SEQPACKET SOCK_SEQPACKET |
223 | # define BOOST_ASIO_OS_DEF_IPPROTO_IP IPPROTO_IP |
224 | # define BOOST_ASIO_OS_DEF_IPPROTO_IPV6 IPPROTO_IPV6 |
225 | # define BOOST_ASIO_OS_DEF_IPPROTO_TCP IPPROTO_TCP |
226 | # define BOOST_ASIO_OS_DEF_IPPROTO_UDP IPPROTO_UDP |
227 | # define BOOST_ASIO_OS_DEF_IPPROTO_ICMP IPPROTO_ICMP |
228 | # define BOOST_ASIO_OS_DEF_IPPROTO_ICMPV6 IPPROTO_ICMPV6 |
229 | # define BOOST_ASIO_OS_DEF_FIONBIO FIONBIO |
230 | # define BOOST_ASIO_OS_DEF_FIONREAD FIONREAD |
231 | # define BOOST_ASIO_OS_DEF_INADDR_ANY INADDR_ANY |
232 | # define BOOST_ASIO_OS_DEF_MSG_OOB MSG_OOB |
233 | # define BOOST_ASIO_OS_DEF_MSG_PEEK MSG_PEEK |
234 | # define BOOST_ASIO_OS_DEF_MSG_DONTROUTE MSG_DONTROUTE |
235 | # define BOOST_ASIO_OS_DEF_MSG_EOR 0 // Not supported on Windows. |
236 | # define BOOST_ASIO_OS_DEF_SHUT_RD SD_RECEIVE |
237 | # define BOOST_ASIO_OS_DEF_SHUT_WR SD_SEND |
238 | # define BOOST_ASIO_OS_DEF_SHUT_RDWR SD_BOTH |
239 | # define BOOST_ASIO_OS_DEF_SOMAXCONN SOMAXCONN |
240 | # define BOOST_ASIO_OS_DEF_SOL_SOCKET SOL_SOCKET |
241 | # define BOOST_ASIO_OS_DEF_SO_BROADCAST SO_BROADCAST |
242 | # define BOOST_ASIO_OS_DEF_SO_DEBUG SO_DEBUG |
243 | # define BOOST_ASIO_OS_DEF_SO_DONTROUTE SO_DONTROUTE |
244 | # define BOOST_ASIO_OS_DEF_SO_KEEPALIVE SO_KEEPALIVE |
245 | # define BOOST_ASIO_OS_DEF_SO_LINGER SO_LINGER |
246 | # define BOOST_ASIO_OS_DEF_SO_OOBINLINE SO_OOBINLINE |
247 | # define BOOST_ASIO_OS_DEF_SO_SNDBUF SO_SNDBUF |
248 | # define BOOST_ASIO_OS_DEF_SO_RCVBUF SO_RCVBUF |
249 | # define BOOST_ASIO_OS_DEF_SO_SNDLOWAT SO_SNDLOWAT |
250 | # define BOOST_ASIO_OS_DEF_SO_RCVLOWAT SO_RCVLOWAT |
251 | # define BOOST_ASIO_OS_DEF_SO_REUSEADDR SO_REUSEADDR |
252 | # define BOOST_ASIO_OS_DEF_TCP_NODELAY TCP_NODELAY |
253 | # define BOOST_ASIO_OS_DEF_IP_MULTICAST_IF IP_MULTICAST_IF |
254 | # define BOOST_ASIO_OS_DEF_IP_MULTICAST_TTL IP_MULTICAST_TTL |
255 | # define BOOST_ASIO_OS_DEF_IP_MULTICAST_LOOP IP_MULTICAST_LOOP |
256 | # define BOOST_ASIO_OS_DEF_IP_ADD_MEMBERSHIP IP_ADD_MEMBERSHIP |
257 | # define BOOST_ASIO_OS_DEF_IP_DROP_MEMBERSHIP IP_DROP_MEMBERSHIP |
258 | # define BOOST_ASIO_OS_DEF_IP_TTL IP_TTL |
259 | # define BOOST_ASIO_OS_DEF_IPV6_UNICAST_HOPS IPV6_UNICAST_HOPS |
260 | # define BOOST_ASIO_OS_DEF_IPV6_MULTICAST_IF IPV6_MULTICAST_IF |
261 | # define BOOST_ASIO_OS_DEF_IPV6_MULTICAST_HOPS IPV6_MULTICAST_HOPS |
262 | # define BOOST_ASIO_OS_DEF_IPV6_MULTICAST_LOOP IPV6_MULTICAST_LOOP |
263 | # define BOOST_ASIO_OS_DEF_IPV6_JOIN_GROUP IPV6_JOIN_GROUP |
264 | # define BOOST_ASIO_OS_DEF_IPV6_LEAVE_GROUP IPV6_LEAVE_GROUP |
265 | # define BOOST_ASIO_OS_DEF_AI_CANONNAME AI_CANONNAME |
266 | # define BOOST_ASIO_OS_DEF_AI_PASSIVE AI_PASSIVE |
267 | # define BOOST_ASIO_OS_DEF_AI_NUMERICHOST AI_NUMERICHOST |
268 | # if defined(AI_NUMERICSERV) |
269 | # define BOOST_ASIO_OS_DEF_AI_NUMERICSERV AI_NUMERICSERV |
270 | # else |
271 | # define BOOST_ASIO_OS_DEF_AI_NUMERICSERV 0 |
272 | # endif |
273 | # if defined(AI_V4MAPPED) |
274 | # define BOOST_ASIO_OS_DEF_AI_V4MAPPED AI_V4MAPPED |
275 | # else |
276 | # define BOOST_ASIO_OS_DEF_AI_V4MAPPED 0 |
277 | # endif |
278 | # if defined(AI_ALL) |
279 | # define BOOST_ASIO_OS_DEF_AI_ALL AI_ALL |
280 | # else |
281 | # define BOOST_ASIO_OS_DEF_AI_ALL 0 |
282 | # endif |
283 | # if defined(AI_ADDRCONFIG) |
284 | # define BOOST_ASIO_OS_DEF_AI_ADDRCONFIG AI_ADDRCONFIG |
285 | # else |
286 | # define BOOST_ASIO_OS_DEF_AI_ADDRCONFIG 0 |
287 | # endif |
288 | # if defined (_WIN32_WINNT) |
289 | const int max_iov_len = 64; |
290 | # else |
291 | const int max_iov_len = 16; |
292 | # endif |
293 | # define BOOST_ASIO_OS_DEF_SA_RESTART 0x1 |
294 | # define BOOST_ASIO_OS_DEF_SA_NOCLDSTOP 0x2 |
295 | # define BOOST_ASIO_OS_DEF_SA_NOCLDWAIT 0x4 |
296 | #else |
297 | typedef int socket_type; |
298 | const int invalid_socket = -1; |
299 | const int socket_error_retval = -1; |
300 | const int max_addr_v4_str_len = INET_ADDRSTRLEN; |
301 | #if defined(INET6_ADDRSTRLEN) |
302 | const int max_addr_v6_str_len = INET6_ADDRSTRLEN + 1 + IF_NAMESIZE; |
303 | #else // defined(INET6_ADDRSTRLEN) |
304 | const int max_addr_v6_str_len = 256; |
305 | #endif // defined(INET6_ADDRSTRLEN) |
306 | typedef sockaddr socket_addr_type; |
307 | typedef in_addr in4_addr_type; |
308 | # if defined(__hpux) |
309 | // HP-UX doesn't provide ip_mreq when _XOPEN_SOURCE_EXTENDED is defined. |
310 | struct in4_mreq_type |
311 | { |
312 | struct in_addr imr_multiaddr; |
313 | struct in_addr imr_interface; |
314 | }; |
315 | # else |
316 | typedef ip_mreq in4_mreq_type; |
317 | # endif |
318 | typedef sockaddr_in sockaddr_in4_type; |
319 | typedef in6_addr in6_addr_type; |
320 | typedef ipv6_mreq in6_mreq_type; |
321 | typedef sockaddr_in6 sockaddr_in6_type; |
322 | typedef sockaddr_storage sockaddr_storage_type; |
323 | typedef sockaddr_un sockaddr_un_type; |
324 | typedef addrinfo addrinfo_type; |
325 | typedef ::linger linger_type; |
326 | typedef int ioctl_arg_type; |
327 | typedef uint32_t u_long_type; |
328 | typedef uint16_t u_short_type; |
329 | #if defined(BOOST_ASIO_HAS_SSIZE_T) |
330 | typedef ssize_t signed_size_type; |
331 | #else // defined(BOOST_ASIO_HAS_SSIZE_T) |
332 | typedef int signed_size_type; |
333 | #endif // defined(BOOST_ASIO_HAS_SSIZE_T) |
334 | # define BOOST_ASIO_OS_DEF(c) BOOST_ASIO_OS_DEF_##c |
335 | # define BOOST_ASIO_OS_DEF_AF_UNSPEC AF_UNSPEC |
336 | # define BOOST_ASIO_OS_DEF_AF_INET AF_INET |
337 | # define BOOST_ASIO_OS_DEF_AF_INET6 AF_INET6 |
338 | # define BOOST_ASIO_OS_DEF_SOCK_STREAM SOCK_STREAM |
339 | # define BOOST_ASIO_OS_DEF_SOCK_DGRAM SOCK_DGRAM |
340 | # define BOOST_ASIO_OS_DEF_SOCK_RAW SOCK_RAW |
341 | # define BOOST_ASIO_OS_DEF_SOCK_SEQPACKET SOCK_SEQPACKET |
342 | # define BOOST_ASIO_OS_DEF_IPPROTO_IP IPPROTO_IP |
343 | # define BOOST_ASIO_OS_DEF_IPPROTO_IPV6 IPPROTO_IPV6 |
344 | # define BOOST_ASIO_OS_DEF_IPPROTO_TCP IPPROTO_TCP |
345 | # define BOOST_ASIO_OS_DEF_IPPROTO_UDP IPPROTO_UDP |
346 | # define BOOST_ASIO_OS_DEF_IPPROTO_ICMP IPPROTO_ICMP |
347 | # define BOOST_ASIO_OS_DEF_IPPROTO_ICMPV6 IPPROTO_ICMPV6 |
348 | # define BOOST_ASIO_OS_DEF_FIONBIO FIONBIO |
349 | # define BOOST_ASIO_OS_DEF_FIONREAD FIONREAD |
350 | # define BOOST_ASIO_OS_DEF_INADDR_ANY INADDR_ANY |
351 | # define BOOST_ASIO_OS_DEF_MSG_OOB MSG_OOB |
352 | # define BOOST_ASIO_OS_DEF_MSG_PEEK MSG_PEEK |
353 | # define BOOST_ASIO_OS_DEF_MSG_DONTROUTE MSG_DONTROUTE |
354 | # define BOOST_ASIO_OS_DEF_MSG_EOR MSG_EOR |
355 | # define BOOST_ASIO_OS_DEF_SHUT_RD SHUT_RD |
356 | # define BOOST_ASIO_OS_DEF_SHUT_WR SHUT_WR |
357 | # define BOOST_ASIO_OS_DEF_SHUT_RDWR SHUT_RDWR |
358 | # define BOOST_ASIO_OS_DEF_SOMAXCONN SOMAXCONN |
359 | # define BOOST_ASIO_OS_DEF_SOL_SOCKET SOL_SOCKET |
360 | # define BOOST_ASIO_OS_DEF_SO_BROADCAST SO_BROADCAST |
361 | # define BOOST_ASIO_OS_DEF_SO_DEBUG SO_DEBUG |
362 | # define BOOST_ASIO_OS_DEF_SO_DONTROUTE SO_DONTROUTE |
363 | # define BOOST_ASIO_OS_DEF_SO_KEEPALIVE SO_KEEPALIVE |
364 | # define BOOST_ASIO_OS_DEF_SO_LINGER SO_LINGER |
365 | # define BOOST_ASIO_OS_DEF_SO_OOBINLINE SO_OOBINLINE |
366 | # define BOOST_ASIO_OS_DEF_SO_SNDBUF SO_SNDBUF |
367 | # define BOOST_ASIO_OS_DEF_SO_RCVBUF SO_RCVBUF |
368 | # define BOOST_ASIO_OS_DEF_SO_SNDLOWAT SO_SNDLOWAT |
369 | # define BOOST_ASIO_OS_DEF_SO_RCVLOWAT SO_RCVLOWAT |
370 | # define BOOST_ASIO_OS_DEF_SO_REUSEADDR SO_REUSEADDR |
371 | # define BOOST_ASIO_OS_DEF_TCP_NODELAY TCP_NODELAY |
372 | # define BOOST_ASIO_OS_DEF_IP_MULTICAST_IF IP_MULTICAST_IF |
373 | # define BOOST_ASIO_OS_DEF_IP_MULTICAST_TTL IP_MULTICAST_TTL |
374 | # define BOOST_ASIO_OS_DEF_IP_MULTICAST_LOOP IP_MULTICAST_LOOP |
375 | # define BOOST_ASIO_OS_DEF_IP_ADD_MEMBERSHIP IP_ADD_MEMBERSHIP |
376 | # define BOOST_ASIO_OS_DEF_IP_DROP_MEMBERSHIP IP_DROP_MEMBERSHIP |
377 | # define BOOST_ASIO_OS_DEF_IP_TTL IP_TTL |
378 | # define BOOST_ASIO_OS_DEF_IPV6_UNICAST_HOPS IPV6_UNICAST_HOPS |
379 | # define BOOST_ASIO_OS_DEF_IPV6_MULTICAST_IF IPV6_MULTICAST_IF |
380 | # define BOOST_ASIO_OS_DEF_IPV6_MULTICAST_HOPS IPV6_MULTICAST_HOPS |
381 | # define BOOST_ASIO_OS_DEF_IPV6_MULTICAST_LOOP IPV6_MULTICAST_LOOP |
382 | # define BOOST_ASIO_OS_DEF_IPV6_JOIN_GROUP IPV6_JOIN_GROUP |
383 | # define BOOST_ASIO_OS_DEF_IPV6_LEAVE_GROUP IPV6_LEAVE_GROUP |
384 | # define BOOST_ASIO_OS_DEF_AI_CANONNAME AI_CANONNAME |
385 | # define BOOST_ASIO_OS_DEF_AI_PASSIVE AI_PASSIVE |
386 | # define BOOST_ASIO_OS_DEF_AI_NUMERICHOST AI_NUMERICHOST |
387 | # if defined(AI_NUMERICSERV) |
388 | # define BOOST_ASIO_OS_DEF_AI_NUMERICSERV AI_NUMERICSERV |
389 | # else |
390 | # define BOOST_ASIO_OS_DEF_AI_NUMERICSERV 0 |
391 | # endif |
392 | // Note: QNX Neutrino 6.3 defines AI_V4MAPPED, AI_ALL and AI_ADDRCONFIG but |
393 | // does not implement them. Therefore they are specifically excluded here. |
394 | # if defined(AI_V4MAPPED) && !defined(__QNXNTO__) |
395 | # define BOOST_ASIO_OS_DEF_AI_V4MAPPED AI_V4MAPPED |
396 | # else |
397 | # define BOOST_ASIO_OS_DEF_AI_V4MAPPED 0 |
398 | # endif |
399 | # if defined(AI_ALL) && !defined(__QNXNTO__) |
400 | # define BOOST_ASIO_OS_DEF_AI_ALL AI_ALL |
401 | # else |
402 | # define BOOST_ASIO_OS_DEF_AI_ALL 0 |
403 | # endif |
404 | # if defined(AI_ADDRCONFIG) && !defined(__QNXNTO__) |
405 | # define BOOST_ASIO_OS_DEF_AI_ADDRCONFIG AI_ADDRCONFIG |
406 | # else |
407 | # define BOOST_ASIO_OS_DEF_AI_ADDRCONFIG 0 |
408 | # endif |
409 | # if defined(IOV_MAX) |
410 | const int max_iov_len = IOV_MAX; |
411 | # else |
412 | // POSIX platforms are not required to define IOV_MAX. |
413 | const int max_iov_len = 16; |
414 | # endif |
415 | # define BOOST_ASIO_OS_DEF_SA_RESTART SA_RESTART |
416 | # define BOOST_ASIO_OS_DEF_SA_NOCLDSTOP SA_NOCLDSTOP |
417 | # define BOOST_ASIO_OS_DEF_SA_NOCLDWAIT SA_NOCLDWAIT |
418 | #endif |
419 | const int custom_socket_option_level = 0xA5100000; |
420 | const int enable_connection_aborted_option = 1; |
421 | const int always_fail_option = 2; |
422 | |
423 | } // namespace detail |
424 | } // namespace asio |
425 | } // namespace boost |
426 | |
427 | #include <boost/asio/detail/pop_options.hpp> |
428 | |
429 | #endif // BOOST_ASIO_DETAIL_SOCKET_TYPES_HPP |
430 | |