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