PageRenderTime 50ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/src/third_party/boost/boost/asio/detail/socket_types.hpp

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