PageRenderTime 45ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/package/boost_1_58_0/boost/asio/detail/socket_types.hpp

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