grpc 1.2.5 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

Files changed (327) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +1434 -399
  3. data/etc/roots.pem +34 -150
  4. data/include/grpc/grpc.h +71 -0
  5. data/include/grpc/impl/codegen/atm.h +5 -0
  6. data/include/grpc/impl/codegen/atm_gcc_atomic.h +6 -0
  7. data/include/grpc/impl/codegen/atm_gcc_sync.h +2 -0
  8. data/include/grpc/impl/codegen/atm_windows.h +11 -0
  9. data/include/grpc/impl/codegen/grpc_types.h +54 -13
  10. data/include/grpc/impl/codegen/port_platform.h +15 -1
  11. data/include/grpc/support/alloc.h +2 -1
  12. data/include/grpc/support/sync.h +4 -0
  13. data/include/grpc/support/tls.h +1 -1
  14. data/src/core/ext/census/gen/trace_context.pb.h +1 -1
  15. data/src/core/ext/census/grpc_filter.c +14 -10
  16. data/src/core/ext/census/grpc_plugin.c +3 -1
  17. data/src/core/ext/census/trace_label.h +1 -1
  18. data/src/core/ext/census/trace_propagation.h +1 -1
  19. data/src/core/ext/census/trace_status.h +1 -1
  20. data/src/core/ext/census/trace_string.h +1 -1
  21. data/src/core/ext/census/tracing.h +1 -1
  22. data/src/core/ext/{client_channel → filters/client_channel}/channel_connectivity.c +56 -27
  23. data/src/core/ext/{client_channel → filters/client_channel}/client_channel.c +407 -202
  24. data/src/core/ext/{client_channel → filters/client_channel}/client_channel.h +10 -6
  25. data/src/core/ext/{client_channel → filters/client_channel}/client_channel_factory.c +1 -1
  26. data/src/core/ext/{client_channel → filters/client_channel}/client_channel_factory.h +4 -4
  27. data/src/core/ext/{client_channel → filters/client_channel}/client_channel_plugin.c +12 -7
  28. data/src/core/ext/{client_channel → filters/client_channel}/connector.c +1 -1
  29. data/src/core/ext/{client_channel → filters/client_channel}/connector.h +3 -5
  30. data/src/core/ext/{client_channel → filters/client_channel}/http_connect_handshaker.c +6 -6
  31. data/src/core/ext/{client_channel → filters/client_channel}/http_connect_handshaker.h +3 -3
  32. data/src/core/ext/{client_channel → filters/client_channel}/http_proxy.c +4 -4
  33. data/src/core/ext/{client_channel → filters/client_channel}/http_proxy.h +3 -3
  34. data/src/core/ext/{client_channel → filters/client_channel}/lb_policy.c +1 -1
  35. data/src/core/ext/{client_channel → filters/client_channel}/lb_policy.h +4 -4
  36. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/grpclb.c +22 -20
  37. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/grpclb.h +4 -4
  38. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/grpclb_channel.h +5 -4
  39. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/grpclb_channel_secure.c +2 -2
  40. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/load_balancer_api.c +1 -1
  41. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/load_balancer_api.h +6 -5
  42. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/proto/grpc/lb/v1/load_balancer.pb.c +1 -1
  43. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/proto/grpc/lb/v1/load_balancer.pb.h +0 -0
  44. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/pick_first/pick_first.c +20 -15
  45. data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/round_robin/round_robin.c +21 -16
  46. data/src/core/ext/{client_channel → filters/client_channel}/lb_policy_factory.c +1 -1
  47. data/src/core/ext/{client_channel → filters/client_channel}/lb_policy_factory.h +5 -5
  48. data/src/core/ext/{client_channel → filters/client_channel}/lb_policy_registry.c +1 -1
  49. data/src/core/ext/{client_channel → filters/client_channel}/lb_policy_registry.h +4 -4
  50. data/src/core/ext/{client_channel → filters/client_channel}/parse_address.c +1 -1
  51. data/src/core/ext/{client_channel → filters/client_channel}/parse_address.h +4 -4
  52. data/src/core/ext/{client_channel → filters/client_channel}/proxy_mapper.c +1 -1
  53. data/src/core/ext/{client_channel → filters/client_channel}/proxy_mapper.h +3 -3
  54. data/src/core/ext/{client_channel → filters/client_channel}/proxy_mapper_registry.c +10 -4
  55. data/src/core/ext/{client_channel → filters/client_channel}/proxy_mapper_registry.h +4 -4
  56. data/src/core/ext/{client_channel → filters/client_channel}/resolver.c +1 -1
  57. data/src/core/ext/{client_channel → filters/client_channel}/resolver.h +4 -4
  58. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c +350 -0
  59. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +66 -0
  60. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c +319 -0
  61. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c +289 -0
  62. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +64 -0
  63. data/src/core/ext/{resolver → filters/client_channel/resolver}/dns/native/dns_resolver.c +21 -5
  64. data/src/core/ext/{resolver → filters/client_channel/resolver}/sockaddr/sockaddr_resolver.c +3 -3
  65. data/src/core/ext/{client_channel → filters/client_channel}/resolver_factory.c +1 -1
  66. data/src/core/ext/{client_channel → filters/client_channel}/resolver_factory.h +6 -6
  67. data/src/core/ext/{client_channel → filters/client_channel}/resolver_registry.c +1 -2
  68. data/src/core/ext/{client_channel → filters/client_channel}/resolver_registry.h +4 -4
  69. data/src/core/ext/filters/client_channel/retry_throttle.c +210 -0
  70. data/src/core/ext/filters/client_channel/retry_throttle.h +65 -0
  71. data/src/core/ext/{client_channel → filters/client_channel}/subchannel.c +49 -43
  72. data/src/core/ext/{client_channel → filters/client_channel}/subchannel.h +21 -7
  73. data/src/core/ext/{client_channel → filters/client_channel}/subchannel_index.c +1 -1
  74. data/src/core/ext/{client_channel → filters/client_channel}/subchannel_index.h +5 -5
  75. data/src/core/ext/{client_channel → filters/client_channel}/uri_parser.c +1 -1
  76. data/src/core/ext/{client_channel → filters/client_channel}/uri_parser.h +3 -3
  77. data/src/core/ext/{load_reporting → filters/load_reporting}/load_reporting.c +4 -2
  78. data/src/core/ext/{load_reporting → filters/load_reporting}/load_reporting.h +3 -3
  79. data/src/core/ext/{load_reporting → filters/load_reporting}/load_reporting_filter.c +17 -14
  80. data/src/core/ext/{load_reporting → filters/load_reporting}/load_reporting_filter.h +4 -4
  81. data/src/core/ext/filters/max_age/max_age_filter.c +439 -0
  82. data/src/core/ext/filters/max_age/max_age_filter.h +39 -0
  83. data/src/core/ext/transport/chttp2/client/chttp2_connector.c +6 -41
  84. data/src/core/ext/transport/chttp2/client/chttp2_connector.h +1 -1
  85. data/src/core/ext/transport/chttp2/client/insecure/channel_create.c +2 -2
  86. data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c +3 -3
  87. data/src/core/ext/transport/chttp2/server/chttp2_server.c +2 -2
  88. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c +2 -5
  89. data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c +2 -2
  90. data/src/core/ext/transport/chttp2/transport/chttp2_transport.c +449 -204
  91. data/src/core/ext/transport/chttp2/transport/frame_data.c +10 -7
  92. data/src/core/ext/transport/chttp2/transport/frame_goaway.c +3 -2
  93. data/src/core/ext/transport/chttp2/transport/frame_ping.c +37 -7
  94. data/src/core/ext/transport/chttp2/transport/frame_ping.h +3 -0
  95. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.c +4 -3
  96. data/src/core/ext/transport/chttp2/transport/frame_settings.c +18 -38
  97. data/src/core/ext/transport/chttp2/transport/frame_settings.h +1 -29
  98. data/src/core/ext/transport/chttp2/transport/frame_window_update.c +2 -2
  99. data/src/core/ext/transport/chttp2/transport/hpack_encoder.c +64 -37
  100. data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +11 -4
  101. data/src/core/ext/transport/chttp2/transport/hpack_parser.c +60 -39
  102. data/src/core/ext/transport/chttp2/transport/hpack_table.c +2 -2
  103. data/src/core/ext/transport/chttp2/transport/http2_settings.c +75 -0
  104. data/src/core/ext/transport/chttp2/transport/http2_settings.h +74 -0
  105. data/src/core/ext/transport/chttp2/transport/incoming_metadata.c +22 -43
  106. data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +8 -10
  107. data/src/core/ext/transport/chttp2/transport/internal.h +24 -2
  108. data/src/core/ext/transport/chttp2/transport/parsing.c +33 -15
  109. data/src/core/ext/transport/chttp2/transport/writing.c +56 -10
  110. data/src/core/lib/channel/channel_args.c +7 -0
  111. data/src/core/lib/channel/channel_args.h +2 -0
  112. data/src/core/lib/channel/channel_stack.c +20 -27
  113. data/src/core/lib/channel/channel_stack.h +18 -16
  114. data/src/core/lib/channel/compress_filter.c +20 -18
  115. data/src/core/lib/channel/connected_channel.c +9 -8
  116. data/src/core/lib/channel/deadline_filter.c +28 -24
  117. data/src/core/lib/channel/deadline_filter.h +3 -3
  118. data/src/core/lib/channel/handshaker.c +3 -2
  119. data/src/core/lib/channel/http_client_filter.c +119 -61
  120. data/src/core/lib/channel/http_server_filter.c +124 -69
  121. data/src/core/lib/channel/message_size_filter.c +23 -19
  122. data/src/core/lib/http/httpcli.c +8 -6
  123. data/src/core/lib/http/httpcli_security_connector.c +5 -5
  124. data/src/core/lib/http/parser.c +57 -31
  125. data/src/core/lib/iomgr/closure.c +15 -0
  126. data/src/core/lib/iomgr/closure.h +4 -0
  127. data/src/core/lib/iomgr/combiner.c +8 -0
  128. data/src/core/lib/iomgr/endpoint_pair.h +2 -3
  129. data/src/core/lib/iomgr/endpoint_pair_posix.c +10 -7
  130. data/src/core/lib/iomgr/endpoint_pair_uv.c +2 -3
  131. data/src/core/lib/iomgr/endpoint_pair_windows.c +9 -6
  132. data/src/core/lib/iomgr/error.c +360 -177
  133. data/src/core/lib/iomgr/error.h +31 -33
  134. data/src/core/lib/iomgr/error_internal.h +30 -9
  135. data/src/core/lib/iomgr/ev_epoll_linux.c +25 -239
  136. data/src/core/lib/iomgr/ev_poll_posix.c +11 -7
  137. data/src/core/lib/iomgr/ev_posix.c +6 -0
  138. data/src/core/lib/iomgr/ev_posix.h +3 -0
  139. data/src/core/lib/iomgr/exec_ctx.c +6 -0
  140. data/src/core/lib/iomgr/executor.c +8 -2
  141. data/src/core/lib/iomgr/load_file.c +6 -3
  142. data/src/core/lib/iomgr/lockfree_event.c +238 -0
  143. data/src/core/{ext/client_channel/initial_connect_string.h → lib/iomgr/lockfree_event.h} +17 -13
  144. data/src/core/lib/iomgr/pollset.h +4 -0
  145. data/src/core/lib/iomgr/pollset_windows.c +2 -2
  146. data/src/core/lib/iomgr/port.h +9 -0
  147. data/src/core/lib/iomgr/resolve_address_posix.c +15 -9
  148. data/src/core/lib/iomgr/resolve_address_uv.c +8 -6
  149. data/src/core/lib/iomgr/resolve_address_windows.c +2 -2
  150. data/src/core/lib/iomgr/resource_quota.c +19 -4
  151. data/src/core/lib/iomgr/resource_quota.h +2 -0
  152. data/src/core/lib/iomgr/sockaddr_utils.c +3 -1
  153. data/src/core/lib/iomgr/socket_factory_posix.c +110 -0
  154. data/src/core/lib/iomgr/socket_factory_posix.h +90 -0
  155. data/src/core/lib/iomgr/socket_utils_common_posix.c +25 -9
  156. data/src/core/lib/iomgr/socket_utils_posix.h +7 -0
  157. data/src/core/lib/iomgr/tcp_client.h +0 -4
  158. data/src/core/lib/iomgr/tcp_client_posix.c +15 -31
  159. data/src/core/lib/iomgr/tcp_client_uv.c +10 -6
  160. data/src/core/lib/iomgr/tcp_client_windows.c +9 -19
  161. data/src/core/lib/iomgr/tcp_posix.c +111 -22
  162. data/src/core/lib/iomgr/tcp_posix.h +3 -4
  163. data/src/core/lib/iomgr/tcp_server_posix.c +39 -417
  164. data/src/core/lib/iomgr/tcp_server_utils_posix.h +135 -0
  165. data/src/core/lib/iomgr/tcp_server_utils_posix_common.c +221 -0
  166. data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.c +196 -0
  167. data/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.c +49 -0
  168. data/src/core/lib/iomgr/tcp_server_uv.c +43 -16
  169. data/src/core/lib/iomgr/tcp_server_windows.c +10 -22
  170. data/src/core/lib/iomgr/tcp_uv.c +16 -13
  171. data/src/core/lib/iomgr/tcp_windows.c +24 -12
  172. data/src/core/lib/iomgr/tcp_windows.h +2 -2
  173. data/src/core/lib/iomgr/timer.h +3 -0
  174. data/src/core/lib/iomgr/timer_generic.c +257 -72
  175. data/src/core/lib/iomgr/timer_generic.h +1 -1
  176. data/src/core/lib/iomgr/timer_heap.c +8 -8
  177. data/src/core/lib/iomgr/udp_server.c +54 -24
  178. data/src/core/lib/iomgr/udp_server.h +7 -7
  179. data/src/core/lib/iomgr/unix_sockets_posix.c +1 -1
  180. data/src/core/lib/iomgr/unix_sockets_posix_noop.c +2 -1
  181. data/src/core/lib/iomgr/wakeup_fd_posix.h +1 -1
  182. data/src/core/lib/profiling/basic_timers.c +1 -1
  183. data/src/core/lib/security/credentials/credentials.h +1 -1
  184. data/src/core/lib/security/credentials/google_default/google_default_credentials.c +10 -9
  185. data/src/core/lib/security/credentials/jwt/json_token.c +1 -1
  186. data/src/core/lib/security/credentials/jwt/jwt_verifier.c +2 -2
  187. data/src/core/lib/security/transport/client_auth_filter.c +33 -26
  188. data/src/core/lib/security/transport/secure_endpoint.c +8 -5
  189. data/src/core/lib/security/transport/security_connector.c +37 -37
  190. data/src/core/lib/security/transport/security_connector.h +1 -1
  191. data/src/core/lib/security/transport/security_handshaker.c +15 -12
  192. data/src/core/lib/security/transport/server_auth_filter.c +20 -18
  193. data/src/core/lib/security/transport/tsi_error.c +5 -3
  194. data/src/core/lib/security/transport/tsi_error.h +1 -1
  195. data/src/core/lib/{security/util → slice}/b64.c +21 -6
  196. data/src/core/lib/{security/util → slice}/b64.h +16 -4
  197. data/src/core/lib/slice/slice.c +4 -2
  198. data/src/core/lib/slice/slice_buffer.c +16 -14
  199. data/src/core/lib/support/arena.c +98 -0
  200. data/src/core/{ext/client_channel/initial_connect_string.c → lib/support/arena.h} +17 -15
  201. data/src/core/{ext/client_channel/default_initial_connect_string.c → lib/support/atm.c} +14 -5
  202. data/src/core/lib/support/cpu_linux.c +5 -0
  203. data/src/core/lib/support/sync.c +4 -0
  204. data/src/core/lib/support/time.c +4 -10
  205. data/src/core/lib/support/wrap_memcpy.c +3 -1
  206. data/src/core/lib/surface/call.c +252 -221
  207. data/src/core/lib/surface/channel.c +72 -21
  208. data/src/core/lib/surface/channel.h +8 -0
  209. data/src/core/lib/surface/completion_queue.c +2 -3
  210. data/src/core/lib/surface/completion_queue_factory.c +77 -0
  211. data/src/core/lib/surface/completion_queue_factory.h +51 -0
  212. data/src/core/lib/surface/init_secure.c +3 -1
  213. data/src/core/lib/surface/lame_client.c +18 -14
  214. data/src/core/lib/surface/server.c +43 -41
  215. data/src/core/lib/surface/validate_metadata.c +8 -4
  216. data/src/core/lib/surface/version.c +2 -2
  217. data/src/core/lib/transport/bdp_estimator.h +1 -1
  218. data/src/core/lib/transport/connectivity_state.c +2 -1
  219. data/src/core/lib/transport/error_utils.c +17 -17
  220. data/src/core/lib/transport/error_utils.h +1 -1
  221. data/src/core/lib/transport/metadata_batch.c +6 -7
  222. data/src/core/lib/transport/pid_controller.c +1 -0
  223. data/src/core/lib/transport/service_config.c +12 -0
  224. data/src/core/lib/transport/service_config.h +6 -0
  225. data/src/core/lib/transport/transport.c +29 -17
  226. data/src/core/lib/transport/transport.h +85 -42
  227. data/src/core/lib/transport/transport_impl.h +5 -3
  228. data/src/core/lib/transport/transport_op_string.c +20 -14
  229. data/src/core/plugin_registry/grpc_plugin_registry.c +8 -0
  230. data/src/core/{lib/tsi → tsi}/fake_transport_security.c +2 -2
  231. data/src/core/{lib/tsi → tsi}/fake_transport_security.h +4 -4
  232. data/src/core/{lib/tsi → tsi}/ssl_transport_security.c +40 -79
  233. data/src/core/{lib/tsi → tsi}/ssl_transport_security.h +44 -21
  234. data/src/core/{lib/tsi → tsi}/ssl_types.h +3 -3
  235. data/src/core/{lib/tsi → tsi}/transport_security.c +2 -2
  236. data/src/core/{lib/tsi → tsi}/transport_security.h +4 -4
  237. data/src/core/{lib/tsi → tsi}/transport_security_interface.h +3 -3
  238. data/src/ruby/ext/grpc/extconf.rb +1 -0
  239. data/src/ruby/ext/grpc/rb_call_credentials.c +2 -2
  240. data/src/ruby/ext/grpc/rb_channel.c +520 -93
  241. data/src/ruby/ext/grpc/rb_channel.h +2 -0
  242. data/src/ruby/ext/grpc/rb_channel_credentials.c +3 -0
  243. data/src/ruby/ext/grpc/rb_compression_options.c +5 -2
  244. data/src/ruby/ext/grpc/rb_event_thread.c +6 -6
  245. data/src/ruby/ext/grpc/rb_grpc.c +29 -7
  246. data/src/ruby/ext/grpc/rb_grpc.h +2 -0
  247. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +10 -0
  248. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +15 -0
  249. data/src/ruby/ext/grpc/rb_server.c +5 -3
  250. data/src/ruby/lib/grpc/version.rb +1 -1
  251. data/src/ruby/spec/channel_connection_spec.rb +173 -0
  252. data/src/ruby/spec/channel_spec.rb +29 -0
  253. data/src/ruby/spec/generic/rpc_server_pool_spec.rb +27 -17
  254. data/third_party/cares/ares_build.h +264 -0
  255. data/third_party/cares/cares/ares.h +636 -0
  256. data/third_party/cares/cares/ares__close_sockets.c +61 -0
  257. data/third_party/cares/cares/ares__get_hostent.c +261 -0
  258. data/third_party/cares/cares/ares__read_line.c +73 -0
  259. data/third_party/cares/cares/ares__timeval.c +111 -0
  260. data/third_party/cares/cares/ares_cancel.c +63 -0
  261. data/third_party/cares/cares/ares_create_query.c +202 -0
  262. data/third_party/cares/cares/ares_data.c +221 -0
  263. data/third_party/cares/cares/ares_data.h +72 -0
  264. data/third_party/cares/cares/ares_destroy.c +108 -0
  265. data/third_party/cares/cares/ares_dns.h +103 -0
  266. data/third_party/cares/cares/ares_expand_name.c +205 -0
  267. data/third_party/cares/cares/ares_expand_string.c +70 -0
  268. data/third_party/cares/cares/ares_fds.c +59 -0
  269. data/third_party/cares/cares/ares_free_hostent.c +41 -0
  270. data/third_party/cares/cares/ares_free_string.c +25 -0
  271. data/third_party/cares/cares/ares_getenv.c +30 -0
  272. data/third_party/cares/cares/ares_getenv.h +26 -0
  273. data/third_party/cares/cares/ares_gethostbyaddr.c +294 -0
  274. data/third_party/cares/cares/ares_gethostbyname.c +518 -0
  275. data/third_party/cares/cares/ares_getnameinfo.c +422 -0
  276. data/third_party/cares/cares/ares_getopt.c +122 -0
  277. data/third_party/cares/cares/ares_getopt.h +53 -0
  278. data/third_party/cares/cares/ares_getsock.c +66 -0
  279. data/third_party/cares/cares/ares_inet_net_pton.h +25 -0
  280. data/third_party/cares/cares/ares_init.c +2146 -0
  281. data/third_party/cares/cares/ares_iphlpapi.h +221 -0
  282. data/third_party/cares/cares/ares_ipv6.h +78 -0
  283. data/third_party/cares/cares/ares_library_init.c +167 -0
  284. data/third_party/cares/cares/ares_library_init.h +42 -0
  285. data/third_party/cares/cares/ares_llist.c +63 -0
  286. data/third_party/cares/cares/ares_llist.h +39 -0
  287. data/third_party/cares/cares/ares_mkquery.c +24 -0
  288. data/third_party/cares/cares/ares_nowarn.c +260 -0
  289. data/third_party/cares/cares/ares_nowarn.h +61 -0
  290. data/third_party/cares/cares/ares_options.c +402 -0
  291. data/third_party/cares/cares/ares_parse_a_reply.c +264 -0
  292. data/third_party/cares/cares/ares_parse_aaaa_reply.c +264 -0
  293. data/third_party/cares/cares/ares_parse_mx_reply.c +170 -0
  294. data/third_party/cares/cares/ares_parse_naptr_reply.c +188 -0
  295. data/third_party/cares/cares/ares_parse_ns_reply.c +183 -0
  296. data/third_party/cares/cares/ares_parse_ptr_reply.c +219 -0
  297. data/third_party/cares/cares/ares_parse_soa_reply.c +133 -0
  298. data/third_party/cares/cares/ares_parse_srv_reply.c +179 -0
  299. data/third_party/cares/cares/ares_parse_txt_reply.c +220 -0
  300. data/third_party/cares/cares/ares_platform.c +11035 -0
  301. data/third_party/cares/cares/ares_platform.h +43 -0
  302. data/third_party/cares/cares/ares_private.h +363 -0
  303. data/third_party/cares/cares/ares_process.c +1359 -0
  304. data/third_party/cares/cares/ares_query.c +186 -0
  305. data/third_party/cares/cares/ares_rules.h +125 -0
  306. data/third_party/cares/cares/ares_search.c +316 -0
  307. data/third_party/cares/cares/ares_send.c +131 -0
  308. data/third_party/cares/cares/ares_setup.h +217 -0
  309. data/third_party/cares/cares/ares_strcasecmp.c +66 -0
  310. data/third_party/cares/cares/ares_strcasecmp.h +30 -0
  311. data/third_party/cares/cares/ares_strdup.c +49 -0
  312. data/third_party/cares/cares/ares_strdup.h +24 -0
  313. data/third_party/cares/cares/ares_strerror.c +56 -0
  314. data/third_party/cares/cares/ares_timeout.c +88 -0
  315. data/third_party/cares/cares/ares_version.c +11 -0
  316. data/third_party/cares/cares/ares_version.h +24 -0
  317. data/third_party/cares/cares/ares_writev.c +79 -0
  318. data/third_party/cares/cares/bitncmp.c +59 -0
  319. data/third_party/cares/cares/bitncmp.h +26 -0
  320. data/third_party/cares/cares/config-win32.h +377 -0
  321. data/third_party/cares/cares/inet_net_pton.c +450 -0
  322. data/third_party/cares/cares/inet_ntop.c +208 -0
  323. data/third_party/cares/cares/setup_once.h +554 -0
  324. data/third_party/cares/cares/windows_port.c +22 -0
  325. data/third_party/cares/config_darwin/ares_config.h +523 -0
  326. data/third_party/cares/config_linux/ares_config.h +524 -0
  327. metadata +164 -68
@@ -0,0 +1,24 @@
1
+ #ifndef HEADER_CARES_STRDUP_H
2
+ #define HEADER_CARES_STRDUP_H
3
+
4
+
5
+ /* Copyright 1998 by the Massachusetts Institute of Technology.
6
+ *
7
+ * Permission to use, copy, modify, and distribute this
8
+ * software and its documentation for any purpose and without
9
+ * fee is hereby granted, provided that the above copyright
10
+ * notice appear in all copies and that both that copyright
11
+ * notice and this permission notice appear in supporting
12
+ * documentation, and that the name of M.I.T. not be used in
13
+ * advertising or publicity pertaining to distribution of the
14
+ * software without specific, written prior permission.
15
+ * M.I.T. makes no representations about the suitability of
16
+ * this software for any purpose. It is provided "as is"
17
+ * without express or implied warranty.
18
+ */
19
+
20
+ #include "ares_setup.h"
21
+
22
+ extern char *ares_strdup(const char *s1);
23
+
24
+ #endif /* HEADER_CARES_STRDUP_H */
@@ -0,0 +1,56 @@
1
+
2
+ /* Copyright 1998 by the Massachusetts Institute of Technology.
3
+ *
4
+ * Permission to use, copy, modify, and distribute this
5
+ * software and its documentation for any purpose and without
6
+ * fee is hereby granted, provided that the above copyright
7
+ * notice appear in all copies and that both that copyright
8
+ * notice and this permission notice appear in supporting
9
+ * documentation, and that the name of M.I.T. not be used in
10
+ * advertising or publicity pertaining to distribution of the
11
+ * software without specific, written prior permission.
12
+ * M.I.T. makes no representations about the suitability of
13
+ * this software for any purpose. It is provided "as is"
14
+ * without express or implied warranty.
15
+ */
16
+
17
+ #include "ares_setup.h"
18
+ #include <assert.h>
19
+ #include "ares.h"
20
+
21
+ const char *ares_strerror(int code)
22
+ {
23
+ /* Return a string literal from a table. */
24
+ const char *errtext[] = {
25
+ "Successful completion",
26
+ "DNS server returned answer with no data",
27
+ "DNS server claims query was misformatted",
28
+ "DNS server returned general failure",
29
+ "Domain name not found",
30
+ "DNS server does not implement requested operation",
31
+ "DNS server refused query",
32
+ "Misformatted DNS query",
33
+ "Misformatted domain name",
34
+ "Unsupported address family",
35
+ "Misformatted DNS reply",
36
+ "Could not contact DNS servers",
37
+ "Timeout while contacting DNS servers",
38
+ "End of file",
39
+ "Error reading file",
40
+ "Out of memory",
41
+ "Channel is being destroyed",
42
+ "Misformatted string",
43
+ "Illegal flags specified",
44
+ "Given hostname is not numeric",
45
+ "Illegal hints flags specified",
46
+ "c-ares library initialization not yet performed",
47
+ "Error loading iphlpapi.dll",
48
+ "Could not find GetNetworkParams function",
49
+ "DNS query cancelled"
50
+ };
51
+
52
+ if(code >= 0 && code < (int)(sizeof(errtext) / sizeof(*errtext)))
53
+ return errtext[code];
54
+ else
55
+ return "unknown";
56
+ }
@@ -0,0 +1,88 @@
1
+
2
+ /* Copyright 1998 by the Massachusetts Institute of Technology.
3
+ *
4
+ * Permission to use, copy, modify, and distribute this
5
+ * software and its documentation for any purpose and without
6
+ * fee is hereby granted, provided that the above copyright
7
+ * notice appear in all copies and that both that copyright
8
+ * notice and this permission notice appear in supporting
9
+ * documentation, and that the name of M.I.T. not be used in
10
+ * advertising or publicity pertaining to distribution of the
11
+ * software without specific, written prior permission.
12
+ * M.I.T. makes no representations about the suitability of
13
+ * this software for any purpose. It is provided "as is"
14
+ * without express or implied warranty.
15
+ */
16
+
17
+ #include "ares_setup.h"
18
+
19
+ #ifdef HAVE_LIMITS_H
20
+ #include <limits.h>
21
+ #endif
22
+
23
+ #include "ares.h"
24
+ #include "ares_private.h"
25
+
26
+ /* return time offset between now and (future) check, in milliseconds */
27
+ static long timeoffset(struct timeval *now, struct timeval *check)
28
+ {
29
+ return (check->tv_sec - now->tv_sec)*1000 +
30
+ (check->tv_usec - now->tv_usec)/1000;
31
+ }
32
+
33
+ /* WARNING: Beware that this is linear in the number of outstanding
34
+ * requests! You are probably far better off just calling ares_process()
35
+ * once per second, rather than calling ares_timeout() to figure out
36
+ * when to next call ares_process().
37
+ */
38
+ struct timeval *ares_timeout(ares_channel channel, struct timeval *maxtv,
39
+ struct timeval *tvbuf)
40
+ {
41
+ struct query *query;
42
+ struct list_node* list_head;
43
+ struct list_node* list_node;
44
+ struct timeval now;
45
+ struct timeval nextstop;
46
+ long offset, min_offset;
47
+
48
+ /* No queries, no timeout (and no fetch of the current time). */
49
+ if (ares__is_list_empty(&(channel->all_queries)))
50
+ return maxtv;
51
+
52
+ /* Find the minimum timeout for the current set of queries. */
53
+ now = ares__tvnow();
54
+ min_offset = -1;
55
+
56
+ list_head = &(channel->all_queries);
57
+ for (list_node = list_head->next; list_node != list_head;
58
+ list_node = list_node->next)
59
+ {
60
+ query = list_node->data;
61
+ if (query->timeout.tv_sec == 0)
62
+ continue;
63
+ offset = timeoffset(&now, &query->timeout);
64
+ if (offset < 0)
65
+ offset = 0;
66
+ if (min_offset == -1 || offset < min_offset)
67
+ min_offset = offset;
68
+ }
69
+
70
+ /* If we found a minimum timeout and it's sooner than the one specified in
71
+ * maxtv (if any), return it. Otherwise go with maxtv.
72
+ */
73
+ if (min_offset != -1)
74
+ {
75
+ int ioffset = (min_offset > (long)INT_MAX) ? INT_MAX : (int)min_offset;
76
+
77
+ nextstop.tv_sec = ioffset/1000;
78
+ nextstop.tv_usec = (ioffset%1000)*1000;
79
+
80
+ if (!maxtv || ares__timedout(maxtv, &nextstop))
81
+ {
82
+ *tvbuf = nextstop;
83
+ return tvbuf;
84
+ }
85
+ }
86
+
87
+ return maxtv;
88
+ }
@@ -0,0 +1,11 @@
1
+
2
+ #include "ares_setup.h"
3
+ #include "ares.h"
4
+
5
+ const char *ares_version(int *version)
6
+ {
7
+ if(version)
8
+ *version = ARES_VERSION;
9
+
10
+ return ARES_VERSION_STR;
11
+ }
@@ -0,0 +1,24 @@
1
+
2
+ #ifndef ARES__VERSION_H
3
+ #define ARES__VERSION_H
4
+
5
+ /* This is the global package copyright */
6
+ #define ARES_COPYRIGHT "2004 - 2016 Daniel Stenberg, <daniel@haxx.se>."
7
+
8
+ #define ARES_VERSION_MAJOR 1
9
+ #define ARES_VERSION_MINOR 11
10
+ #define ARES_VERSION_PATCH 1
11
+ #define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
12
+ (ARES_VERSION_MINOR<<8)|\
13
+ (ARES_VERSION_PATCH))
14
+ #define ARES_VERSION_STR "1.11.1-DEV"
15
+
16
+ #if (ARES_VERSION >= 0x010700)
17
+ # define CARES_HAVE_ARES_LIBRARY_INIT 1
18
+ # define CARES_HAVE_ARES_LIBRARY_CLEANUP 1
19
+ #else
20
+ # undef CARES_HAVE_ARES_LIBRARY_INIT
21
+ # undef CARES_HAVE_ARES_LIBRARY_CLEANUP
22
+ #endif
23
+
24
+ #endif
@@ -0,0 +1,79 @@
1
+
2
+
3
+ /* Copyright 1998 by the Massachusetts Institute of Technology.
4
+ *
5
+ * Permission to use, copy, modify, and distribute this
6
+ * software and its documentation for any purpose and without
7
+ * fee is hereby granted, provided that the above copyright
8
+ * notice appear in all copies and that both that copyright
9
+ * notice and this permission notice appear in supporting
10
+ * documentation, and that the name of M.I.T. not be used in
11
+ * advertising or publicity pertaining to distribution of the
12
+ * software without specific, written prior permission.
13
+ * M.I.T. makes no representations about the suitability of
14
+ * this software for any purpose. It is provided "as is"
15
+ * without express or implied warranty.
16
+ */
17
+
18
+ #include "ares_setup.h"
19
+
20
+ #ifdef HAVE_LIMITS_H
21
+ # include <limits.h>
22
+ #endif
23
+
24
+ #include "ares.h"
25
+ #include "ares_private.h"
26
+
27
+ #ifndef HAVE_WRITEV
28
+ ssize_t ares_writev(ares_socket_t s, const struct iovec *iov, int iovcnt)
29
+ {
30
+ char *buffer, *bp;
31
+ int i;
32
+ size_t bytes = 0;
33
+ ssize_t result;
34
+
35
+ /* Validate iovcnt */
36
+ if (iovcnt <= 0)
37
+ {
38
+ SET_ERRNO(EINVAL);
39
+ return (-1);
40
+ }
41
+
42
+ /* Validate and find the sum of the iov_len values in the iov array */
43
+ for (i = 0; i < iovcnt; i++)
44
+ {
45
+ if (iov[i].iov_len > INT_MAX - bytes)
46
+ {
47
+ SET_ERRNO(EINVAL);
48
+ return (-1);
49
+ }
50
+ bytes += iov[i].iov_len;
51
+ }
52
+
53
+ if (bytes == 0)
54
+ return (0);
55
+
56
+ /* Allocate a temporary buffer to hold the data */
57
+ buffer = ares_malloc(bytes);
58
+ if (!buffer)
59
+ {
60
+ SET_ERRNO(ENOMEM);
61
+ return (-1);
62
+ }
63
+
64
+ /* Copy the data into buffer */
65
+ for (bp = buffer, i = 0; i < iovcnt; ++i)
66
+ {
67
+ memcpy (bp, iov[i].iov_base, iov[i].iov_len);
68
+ bp += iov[i].iov_len;
69
+ }
70
+
71
+ /* Send buffer contents */
72
+ result = swrite(s, buffer, bytes);
73
+
74
+ ares_free(buffer);
75
+
76
+ return (result);
77
+ }
78
+ #endif
79
+
@@ -0,0 +1,59 @@
1
+
2
+ /*
3
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
4
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
5
+ *
6
+ * Permission to use, copy, modify, and distribute this software for any
7
+ * purpose with or without fee is hereby granted, provided that the above
8
+ * copyright notice and this permission notice appear in all copies.
9
+ *
10
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
11
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
13
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
16
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
+ */
18
+
19
+ #ifndef HAVE_BITNCMP
20
+
21
+ #include "ares_setup.h"
22
+ #include "bitncmp.h"
23
+
24
+ /*
25
+ * int
26
+ * bitncmp(l, r, n)
27
+ * compare bit masks l and r, for n bits.
28
+ * return:
29
+ * <0, >0, or 0 in the libc tradition.
30
+ * note:
31
+ * network byte order assumed. this means 192.5.5.240/28 has
32
+ * 0x11110000 in its fourth octet.
33
+ * author:
34
+ * Paul Vixie (ISC), June 1996
35
+ */
36
+ int ares__bitncmp(const void *l, const void *r, int n)
37
+ {
38
+ unsigned int lb, rb;
39
+ int x, b;
40
+
41
+ b = n / 8;
42
+ x = memcmp(l, r, b);
43
+ if (x || (n % 8) == 0)
44
+ return (x);
45
+
46
+ lb = ((const unsigned char *)l)[b];
47
+ rb = ((const unsigned char *)r)[b];
48
+ for (b = n % 8; b > 0; b--) {
49
+ if ((lb & 0x80) != (rb & 0x80)) {
50
+ if (lb & 0x80)
51
+ return (1);
52
+ return (-1);
53
+ }
54
+ lb <<= 1;
55
+ rb <<= 1;
56
+ }
57
+ return (0);
58
+ }
59
+ #endif
@@ -0,0 +1,26 @@
1
+ #ifndef __ARES_BITNCMP_H
2
+ #define __ARES_BITNCMP_H
3
+
4
+
5
+ /* Copyright (C) 2005, 2013 by Dominick Meglio
6
+ *
7
+ * Permission to use, copy, modify, and distribute this
8
+ * software and its documentation for any purpose and without
9
+ * fee is hereby granted, provided that the above copyright
10
+ * notice appear in all copies and that both that copyright
11
+ * notice and this permission notice appear in supporting
12
+ * documentation, and that the name of M.I.T. not be used in
13
+ * advertising or publicity pertaining to distribution of the
14
+ * software without specific, written prior permission.
15
+ * M.I.T. makes no representations about the suitability of
16
+ * this software for any purpose. It is provided "as is"
17
+ * without express or implied warranty.
18
+ */
19
+
20
+ #ifndef HAVE_BITNCMP
21
+ int ares__bitncmp(const void *l, const void *r, int n);
22
+ #else
23
+ #define ares__bitncmp(x,y,z) bitncmp(x,y,z)
24
+ #endif
25
+
26
+ #endif /* __ARES_BITNCMP_H */
@@ -0,0 +1,377 @@
1
+ #ifndef HEADER_CARES_CONFIG_WIN32_H
2
+ #define HEADER_CARES_CONFIG_WIN32_H
3
+
4
+ /* Copyright (C) 2004 - 2011 by Daniel Stenberg et al
5
+ *
6
+ * Permission to use, copy, modify, and distribute this software and its
7
+ * documentation for any purpose and without fee is hereby granted, provided
8
+ * that the above copyright notice appear in all copies and that both that
9
+ * copyright notice and this permission notice appear in supporting
10
+ * documentation, and that the name of M.I.T. not be used in advertising or
11
+ * publicity pertaining to distribution of the software without specific,
12
+ * written prior permission. M.I.T. makes no representations about the
13
+ * suitability of this software for any purpose. It is provided "as is"
14
+ * without express or implied warranty.
15
+ */
16
+
17
+ /* ================================================================ */
18
+ /* c-ares/config-win32.h - Hand crafted config file for Windows */
19
+ /* ================================================================ */
20
+
21
+ /* ---------------------------------------------------------------- */
22
+ /* HEADER FILES */
23
+ /* ---------------------------------------------------------------- */
24
+
25
+ /* Define if you have the <assert.h> header file. */
26
+ #define HAVE_ASSERT_H 1
27
+
28
+ /* Define if you have the <errno.h> header file. */
29
+ #define HAVE_ERRNO_H 1
30
+
31
+ /* Define if you have the <getopt.h> header file. */
32
+ #if defined(__MINGW32__) || defined(__POCC__)
33
+ #define HAVE_GETOPT_H 1
34
+ #endif
35
+
36
+ /* Define if you have the <limits.h> header file. */
37
+ #define HAVE_LIMITS_H 1
38
+
39
+ /* Define if you have the <process.h> header file. */
40
+ #ifndef __SALFORDC__
41
+ #define HAVE_PROCESS_H 1
42
+ #endif
43
+
44
+ /* Define if you have the <signal.h> header file. */
45
+ #define HAVE_SIGNAL_H 1
46
+
47
+ /* Define if you have the <sys/time.h> header file */
48
+ /* #define HAVE_SYS_TIME_H 1 */
49
+
50
+ /* Define if you have the <time.h> header file. */
51
+ #define HAVE_TIME_H 1
52
+
53
+ /* Define if you have the <unistd.h> header file. */
54
+ #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \
55
+ defined(__POCC__)
56
+ #define HAVE_UNISTD_H 1
57
+ #endif
58
+
59
+ /* Define if you have the <windows.h> header file. */
60
+ #define HAVE_WINDOWS_H 1
61
+
62
+ /* Define if you have the <winsock.h> header file. */
63
+ #define HAVE_WINSOCK_H 1
64
+
65
+ /* Define if you have the <winsock2.h> header file. */
66
+ #ifndef __SALFORDC__
67
+ #define HAVE_WINSOCK2_H 1
68
+ #endif
69
+
70
+ /* Define if you have the <ws2tcpip.h> header file. */
71
+ #ifndef __SALFORDC__
72
+ #define HAVE_WS2TCPIP_H 1
73
+ #endif
74
+
75
+ /* ---------------------------------------------------------------- */
76
+ /* OTHER HEADER INFO */
77
+ /* ---------------------------------------------------------------- */
78
+
79
+ /* Define if sig_atomic_t is an available typedef. */
80
+ #define HAVE_SIG_ATOMIC_T 1
81
+
82
+ /* Define if you have the ANSI C header files. */
83
+ #define STDC_HEADERS 1
84
+
85
+ /* Define if you can safely include both <sys/time.h> and <time.h>. */
86
+ /* #define TIME_WITH_SYS_TIME 1 */
87
+
88
+ /* ---------------------------------------------------------------- */
89
+ /* FUNCTIONS */
90
+ /* ---------------------------------------------------------------- */
91
+
92
+ /* Define if you have the closesocket function. */
93
+ #define HAVE_CLOSESOCKET 1
94
+
95
+ /* Define if you have the getenv function. */
96
+ #define HAVE_GETENV 1
97
+
98
+ /* Define if you have the gethostname function. */
99
+ #define HAVE_GETHOSTNAME 1
100
+
101
+ /* Define if you have the ioctlsocket function. */
102
+ #define HAVE_IOCTLSOCKET 1
103
+
104
+ /* Define if you have a working ioctlsocket FIONBIO function. */
105
+ #define HAVE_IOCTLSOCKET_FIONBIO 1
106
+
107
+ /* Define if you have the strcasecmp function. */
108
+ /* #define HAVE_STRCASECMP 1 */
109
+
110
+ /* Define if you have the strdup function. */
111
+ #define HAVE_STRDUP 1
112
+
113
+ /* Define if you have the stricmp function. */
114
+ #define HAVE_STRICMP 1
115
+
116
+ /* Define if you have the strncasecmp function. */
117
+ /* #define HAVE_STRNCASECMP 1 */
118
+
119
+ /* Define if you have the strnicmp function. */
120
+ #define HAVE_STRNICMP 1
121
+
122
+ /* Define if you have the recv function. */
123
+ #define HAVE_RECV 1
124
+
125
+ /* Define to the type of arg 1 for recv. */
126
+ #define RECV_TYPE_ARG1 SOCKET
127
+
128
+ /* Define to the type of arg 2 for recv. */
129
+ #define RECV_TYPE_ARG2 char *
130
+
131
+ /* Define to the type of arg 3 for recv. */
132
+ #define RECV_TYPE_ARG3 int
133
+
134
+ /* Define to the type of arg 4 for recv. */
135
+ #define RECV_TYPE_ARG4 int
136
+
137
+ /* Define to the function return type for recv. */
138
+ #define RECV_TYPE_RETV int
139
+
140
+ /* Define if you have the recvfrom function. */
141
+ #define HAVE_RECVFROM 1
142
+
143
+ /* Define to the type of arg 1 for recvfrom. */
144
+ #define RECVFROM_TYPE_ARG1 SOCKET
145
+
146
+ /* Define to the type pointed by arg 2 for recvfrom. */
147
+ #define RECVFROM_TYPE_ARG2 char
148
+
149
+ /* Define to the type of arg 3 for recvfrom. */
150
+ #define RECVFROM_TYPE_ARG3 int
151
+
152
+ /* Define to the type of arg 4 for recvfrom. */
153
+ #define RECVFROM_TYPE_ARG4 int
154
+
155
+ /* Define to the type pointed by arg 5 for recvfrom. */
156
+ #define RECVFROM_TYPE_ARG5 struct sockaddr
157
+
158
+ /* Define to the type pointed by arg 6 for recvfrom. */
159
+ #define RECVFROM_TYPE_ARG6 int
160
+
161
+ /* Define to the function return type for recvfrom. */
162
+ #define RECVFROM_TYPE_RETV int
163
+
164
+ /* Define if you have the send function. */
165
+ #define HAVE_SEND 1
166
+
167
+ /* Define to the type of arg 1 for send. */
168
+ #define SEND_TYPE_ARG1 SOCKET
169
+
170
+ /* Define to the type qualifier of arg 2 for send. */
171
+ #define SEND_QUAL_ARG2 const
172
+
173
+ /* Define to the type of arg 2 for send. */
174
+ #define SEND_TYPE_ARG2 char *
175
+
176
+ /* Define to the type of arg 3 for send. */
177
+ #define SEND_TYPE_ARG3 int
178
+
179
+ /* Define to the type of arg 4 for send. */
180
+ #define SEND_TYPE_ARG4 int
181
+
182
+ /* Define to the function return type for send. */
183
+ #define SEND_TYPE_RETV int
184
+
185
+ /* Specifics for the Watt-32 tcp/ip stack. */
186
+ #ifdef WATT32
187
+ #define SOCKET int
188
+ #define NS_INADDRSZ 4
189
+ #define HAVE_ARPA_NAMESER_H 1
190
+ #define HAVE_ARPA_INET_H 1
191
+ #define HAVE_NETDB_H 1
192
+ #define HAVE_NETINET_IN_H 1
193
+ #define HAVE_SYS_SOCKET_H 1
194
+ #define HAVE_NETINET_TCP_H 1
195
+ #define HAVE_AF_INET6 1
196
+ #define HAVE_PF_INET6 1
197
+ #define HAVE_STRUCT_IN6_ADDR 1
198
+ #define HAVE_STRUCT_SOCKADDR_IN6 1
199
+ #undef HAVE_WINSOCK_H
200
+ #undef HAVE_WINSOCK2_H
201
+ #undef HAVE_WS2TCPIP_H
202
+ #endif
203
+
204
+ /* ---------------------------------------------------------------- */
205
+ /* TYPEDEF REPLACEMENTS */
206
+ /* ---------------------------------------------------------------- */
207
+
208
+ /* Define if in_addr_t is not an available 'typedefed' type. */
209
+ #define in_addr_t unsigned long
210
+
211
+ /* Define to the return type of signal handlers (int or void). */
212
+ #define RETSIGTYPE void
213
+
214
+ #ifdef __cplusplus
215
+ /* Compiling headers in C++ mode means bool is available */
216
+ #define HAVE_BOOL_T
217
+ #endif
218
+
219
+ /* Define if ssize_t is not an available 'typedefed' type. */
220
+ #ifndef _SSIZE_T_DEFINED
221
+ # if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \
222
+ defined(__POCC__) || \
223
+ defined(__MINGW32__)
224
+ # elif defined(_WIN64)
225
+ # define _SSIZE_T_DEFINED
226
+ # define ssize_t __int64
227
+ # else
228
+ # define _SSIZE_T_DEFINED
229
+ # define ssize_t int
230
+ # endif
231
+ #endif
232
+
233
+ /* ---------------------------------------------------------------- */
234
+ /* TYPE SIZES */
235
+ /* ---------------------------------------------------------------- */
236
+
237
+ /* ---------------------------------------------------------------- */
238
+ /* STRUCT RELATED */
239
+ /* ---------------------------------------------------------------- */
240
+
241
+ /* Define if you have struct addrinfo. */
242
+ #define HAVE_STRUCT_ADDRINFO 1
243
+
244
+ /* Define if you have struct sockaddr_storage. */
245
+ #if !defined(__SALFORDC__) && !defined(__BORLANDC__)
246
+ #define HAVE_STRUCT_SOCKADDR_STORAGE 1
247
+ #endif
248
+
249
+ /* Define if you have struct timeval. */
250
+ #define HAVE_STRUCT_TIMEVAL 1
251
+
252
+ /* ---------------------------------------------------------------- */
253
+ /* COMPILER SPECIFIC */
254
+ /* ---------------------------------------------------------------- */
255
+
256
+ /* Define to avoid VS2005 complaining about portable C functions. */
257
+ #if defined(_MSC_VER) && (_MSC_VER >= 1400)
258
+ # define _CRT_SECURE_NO_DEPRECATE 1
259
+ # define _CRT_NONSTDC_NO_DEPRECATE 1
260
+ #endif
261
+
262
+ /* Officially, Microsoft's Windows SDK versions 6.X do not support Windows
263
+ 2000 as a supported build target. VS2008 default installations provide
264
+ an embedded Windows SDK v6.0A along with the claim that Windows 2000 is
265
+ a valid build target for VS2008. Popular belief is that binaries built
266
+ with VS2008 using Windows SDK versions 6.X and Windows 2000 as a build
267
+ target are functional. */
268
+ #if defined(_MSC_VER) && (_MSC_VER >= 1500)
269
+ # define VS2008_MIN_TARGET 0x0500
270
+ #endif
271
+
272
+ /* When no build target is specified VS2008 default build target is Windows
273
+ Vista, which leaves out even Winsows XP. If no build target has been given
274
+ for VS2008 we will target the minimum Officially supported build target,
275
+ which happens to be Windows XP. */
276
+ #if defined(_MSC_VER) && (_MSC_VER >= 1500)
277
+ # define VS2008_DEF_TARGET 0x0501
278
+ #endif
279
+
280
+ /* VS2008 default target settings and minimum build target check. */
281
+ #if defined(_MSC_VER) && (_MSC_VER >= 1500)
282
+ # ifndef _WIN32_WINNT
283
+ # define _WIN32_WINNT VS2008_DEF_TARGET
284
+ # endif
285
+ # ifndef WINVER
286
+ # define WINVER VS2008_DEF_TARGET
287
+ # endif
288
+ # if (_WIN32_WINNT < VS2008_MIN_TARGET) || (WINVER < VS2008_MIN_TARGET)
289
+ # error VS2008 does not support Windows build targets prior to Windows 2000
290
+ # endif
291
+ #endif
292
+
293
+ /* When no build target is specified Pelles C 5.00 and later default build
294
+ target is Windows Vista. We override default target to be Windows 2000. */
295
+ #if defined(__POCC__) && (__POCC__ >= 500)
296
+ # ifndef _WIN32_WINNT
297
+ # define _WIN32_WINNT 0x0500
298
+ # endif
299
+ # ifndef WINVER
300
+ # define WINVER 0x0500
301
+ # endif
302
+ #endif
303
+
304
+ /* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is
305
+ quite convoluted, compiler dependent and even build target dependent. */
306
+ #if defined(HAVE_WS2TCPIP_H)
307
+ # if defined(__POCC__)
308
+ # define HAVE_FREEADDRINFO 1
309
+ # define HAVE_GETADDRINFO 1
310
+ # define HAVE_GETNAMEINFO 1
311
+ # elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
312
+ # define HAVE_FREEADDRINFO 1
313
+ # define HAVE_GETADDRINFO 1
314
+ # define HAVE_GETNAMEINFO 1
315
+ # elif defined(_MSC_VER) && (_MSC_VER >= 1200)
316
+ # define HAVE_FREEADDRINFO 1
317
+ # define HAVE_GETADDRINFO 1
318
+ # define HAVE_GETNAMEINFO 1
319
+ # endif
320
+ #endif
321
+
322
+ #if defined(__POCC__)
323
+ # ifndef _MSC_VER
324
+ # error Microsoft extensions /Ze compiler option is required
325
+ # endif
326
+ # ifndef __POCC__OLDNAMES
327
+ # error Compatibility names /Go compiler option is required
328
+ # endif
329
+ #endif
330
+
331
+ /* ---------------------------------------------------------------- */
332
+ /* IPV6 COMPATIBILITY */
333
+ /* ---------------------------------------------------------------- */
334
+
335
+ /* Define if you have address family AF_INET6. */
336
+ #ifdef HAVE_WINSOCK2_H
337
+ #define HAVE_AF_INET6 1
338
+ #endif
339
+
340
+ /* Define if you have protocol family PF_INET6. */
341
+ #ifdef HAVE_WINSOCK2_H
342
+ #define HAVE_PF_INET6 1
343
+ #endif
344
+
345
+ /* Define if you have struct in6_addr. */
346
+ #ifdef HAVE_WS2TCPIP_H
347
+ #define HAVE_STRUCT_IN6_ADDR 1
348
+ #endif
349
+
350
+ /* Define if you have struct sockaddr_in6. */
351
+ #ifdef HAVE_WS2TCPIP_H
352
+ #define HAVE_STRUCT_SOCKADDR_IN6 1
353
+ #endif
354
+
355
+ /* Define if you have sockaddr_in6 with scopeid. */
356
+ #ifdef HAVE_WS2TCPIP_H
357
+ #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
358
+ #endif
359
+
360
+ /* ---------------------------------------------------------------- */
361
+ /* Win CE */
362
+ /* ---------------------------------------------------------------- */
363
+
364
+ /* FIXME: A proper config-win32ce.h should be created to hold these */
365
+
366
+ /*
367
+ * System error codes for Windows CE
368
+ */
369
+
370
+ #if defined(_WIN32_WCE) && !defined(HAVE_ERRNO_H)
371
+ # define ENOENT ERROR_FILE_NOT_FOUND
372
+ # define ESRCH ERROR_PATH_NOT_FOUND
373
+ # define ENOMEM ERROR_NOT_ENOUGH_MEMORY
374
+ # define ENOSPC ERROR_INVALID_PARAMETER
375
+ #endif
376
+
377
+ #endif /* HEADER_CARES_CONFIG_WIN32_H */