grpc 1.74.1 → 1.75.0.pre1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Makefile +83 -41
- data/include/grpc/credentials.h +7 -1
- data/src/core/call/client_call.cc +4 -4
- data/src/core/call/filter_fusion.h +1230 -0
- data/src/core/call/metadata.cc +22 -0
- data/src/core/call/metadata.h +24 -2
- data/src/core/channelz/channelz.cc +10 -17
- data/src/core/channelz/channelz.h +58 -19
- data/src/core/channelz/channelz_registry.cc +0 -162
- data/src/core/channelz/channelz_registry.h +14 -7
- data/src/core/channelz/property_list.cc +19 -23
- data/src/core/channelz/property_list.h +3 -1
- data/src/core/channelz/v2tov1/convert.cc +683 -0
- data/src/core/channelz/v2tov1/convert.h +58 -0
- data/src/core/channelz/v2tov1/legacy_api.cc +425 -0
- data/src/core/channelz/v2tov1/legacy_api.h +32 -0
- data/src/core/channelz/v2tov1/property_list.cc +118 -0
- data/src/core/channelz/v2tov1/property_list.h +52 -0
- data/src/core/client_channel/client_channel_filter.cc +5 -4
- data/src/core/client_channel/client_channel_filter.h +2 -2
- data/src/core/client_channel/client_channel_internal.h +2 -1
- data/src/core/client_channel/load_balanced_call_destination.cc +6 -5
- data/src/core/client_channel/subchannel.cc +14 -6
- data/src/core/client_channel/subchannel.h +2 -0
- data/src/core/config/core_configuration.cc +3 -1
- data/src/core/config/core_configuration.h +12 -0
- data/src/core/credentials/transport/alts/alts_credentials.cc +5 -0
- data/src/core/credentials/transport/alts/check_gcp_environment_windows.cc +2 -0
- data/src/core/credentials/transport/channel_creds_registry_init.cc +3 -1
- data/src/core/credentials/transport/ssl/ssl_credentials.cc +1 -1
- data/src/core/credentials/transport/ssl/ssl_security_connector.cc +8 -3
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.cc +29 -24
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.h +19 -8
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.cc +96 -54
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.h +15 -2
- data/src/core/credentials/transport/tls/spiffe_utils.cc +371 -0
- data/src/core/credentials/transport/tls/spiffe_utils.h +171 -0
- data/src/core/credentials/transport/tls/ssl_utils.cc +11 -10
- data/src/core/credentials/transport/tls/ssl_utils.h +4 -2
- data/src/core/credentials/transport/tls/tls_credentials.cc +2 -0
- data/src/core/credentials/transport/tls/tls_security_connector.cc +11 -26
- data/src/core/credentials/transport/tls/tls_security_connector.h +12 -12
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +1 -2
- data/src/core/ext/filters/http/client/http_client_filter.cc +3 -6
- data/src/core/ext/filters/http/client_authority_filter.cc +1 -2
- data/src/core/ext/filters/http/message_compress/compression_filter.cc +8 -8
- data/src/core/ext/filters/http/server/http_server_filter.cc +3 -6
- data/src/core/ext/filters/message_size/message_size_filter.cc +4 -4
- data/src/core/ext/filters/rbac/rbac_filter.cc +1 -1
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +3 -5
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +3 -2
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.h +1 -0
- data/src/core/ext/transport/chttp2/transport/frame.cc +89 -6
- data/src/core/ext/transport/chttp2/transport/frame.h +38 -0
- data/src/core/ext/transport/chttp2/transport/header_assembler.h +5 -14
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +4 -1
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +294 -78
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +128 -9
- data/src/core/ext/transport/chttp2/transport/http2_settings.cc +11 -38
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +52 -35
- data/src/core/ext/transport/chttp2/transport/http2_settings_manager.cc +61 -0
- data/src/core/ext/transport/chttp2/transport/http2_settings_manager.h +142 -0
- data/src/core/ext/transport/chttp2/transport/http2_transport.cc +81 -3
- data/src/core/ext/transport/chttp2/transport/http2_transport.h +12 -1
- data/src/core/ext/transport/chttp2/transport/message_assembler.h +2 -2
- data/src/core/ext/transport/chttp2/transport/parsing.cc +2 -1
- data/src/core/ext/transport/chttp2/transport/ping_promise.cc +2 -1
- data/src/core/ext/transport/chttp2/transport/ping_promise.h +22 -5
- data/src/core/ext/transport/chttp2/transport/stream_data_queue.h +607 -0
- data/src/core/ext/transport/chttp2/transport/writable_streams.h +254 -0
- data/src/core/ext/transport/chttp2/transport/writing.cc +6 -4
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/channelz.upb.h +4959 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/channelz.upb_minitable.c +1111 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/channelz.upb_minitable.h +108 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb.h +142 -54
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.c +18 -14
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.h +2 -2
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/channelz.upbdefs.c +716 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/channelz.upbdefs.h +227 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/property_list.upbdefs.c +86 -88
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/property_list.upbdefs.h +2 -2
- data/src/core/filter/auth/auth_filters.h +2 -2
- data/src/core/filter/fused_filters.cc +154 -0
- data/src/core/handshaker/security/legacy_secure_endpoint.cc +1 -1
- data/src/core/handshaker/security/pipelined_secure_endpoint.cc +965 -0
- data/src/core/handshaker/security/secure_endpoint.cc +28 -13
- data/src/core/handshaker/security/secure_endpoint.h +8 -0
- data/src/core/lib/channel/promise_based_filter.cc +15 -25
- data/src/core/lib/channel/promise_based_filter.h +6 -5
- data/src/core/lib/event_engine/ares_resolver.h +3 -1
- data/src/core/lib/event_engine/cf_engine/cf_engine.cc +9 -5
- data/src/core/lib/event_engine/cf_engine/cf_engine.h +2 -1
- data/src/core/lib/event_engine/cf_engine/cfsocket_listener.cc +263 -0
- data/src/core/lib/event_engine/cf_engine/cfsocket_listener.h +107 -0
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +31 -3
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.h +12 -0
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +12 -10
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h +6 -4
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +15 -14
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +7 -5
- data/src/core/lib/event_engine/posix_engine/event_poller.h +0 -8
- data/src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc +11 -5
- data/src/core/lib/event_engine/posix_engine/event_poller_posix_default.h +3 -2
- data/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h +1 -0
- data/src/core/lib/event_engine/posix_engine/lockfree_event.cc +4 -4
- data/src/core/lib/event_engine/posix_engine/lockfree_event.h +3 -4
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +2 -2
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +188 -199
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +30 -45
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +1 -1
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +1 -1
- data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc +2 -1
- data/src/core/lib/experiments/experiments.cc +120 -6
- data/src/core/lib/experiments/experiments.h +46 -3
- data/src/core/lib/iomgr/combiner.cc +1 -1
- data/src/core/lib/iomgr/exec_ctx.h +3 -9
- data/src/core/lib/iomgr/socket_mutator.cc +1 -1
- data/src/core/lib/iomgr/socket_utils_posix.cc +1 -1
- data/src/core/lib/iomgr/socket_utils_posix.h +1 -1
- data/src/core/lib/iomgr/tcp_client_posix.cc +1 -1
- data/src/core/lib/iomgr/tcp_posix.cc +3 -3
- data/src/core/lib/promise/activity.h +2 -2
- data/src/core/lib/promise/mpsc.cc +8 -8
- data/src/core/lib/promise/party.cc +7 -7
- data/src/core/lib/promise/party.h +4 -4
- data/src/core/lib/promise/poll.h +10 -0
- data/src/core/lib/resource_quota/memory_quota.cc +90 -3
- data/src/core/lib/resource_quota/memory_quota.h +20 -9
- data/src/core/lib/resource_quota/periodic_update.cc +14 -0
- data/src/core/lib/resource_quota/periodic_update.h +8 -0
- data/src/core/lib/resource_quota/resource_quota.cc +15 -4
- data/src/core/lib/resource_quota/resource_quota.h +3 -0
- data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +1 -2
- data/src/core/lib/surface/call.cc +5 -5
- data/src/core/lib/surface/call.h +6 -5
- data/src/core/lib/surface/completion_queue.cc +2 -4
- data/src/core/lib/surface/filter_stack_call.cc +1 -1
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/promise_endpoint.cc +2 -2
- data/src/core/lib/transport/promise_endpoint.h +3 -3
- data/src/core/load_balancing/endpoint_list.cc +29 -2
- data/src/core/load_balancing/grpclb/client_load_reporting_filter.cc +3 -3
- data/src/core/load_balancing/grpclb/client_load_reporting_filter.h +1 -1
- data/src/core/load_balancing/pick_first/pick_first.cc +12 -5
- data/src/core/load_balancing/xds/xds_cluster_impl.cc +5 -3
- data/src/core/net/socket_mutator.cc +19 -0
- data/src/core/net/socket_mutator.h +25 -0
- data/src/core/plugin_registry/grpc_plugin_registry.cc +6 -0
- data/src/core/resolver/dns/c_ares/grpc_ares_ev_driver.h +6 -1
- data/src/core/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +2 -1
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper.cc +8 -5
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper.h +2 -1
- data/src/core/resolver/xds/xds_dependency_manager.cc +1 -1
- data/src/core/server/server.cc +1 -1
- data/src/core/server/server_call_tracer_filter.cc +0 -66
- data/src/core/server/server_call_tracer_filter.h +64 -0
- data/src/core/server/server_config_selector_filter.cc +1 -1
- data/src/core/service_config/service_config_channel_arg_filter.cc +3 -60
- data/src/core/service_config/service_config_channel_arg_filter.h +82 -0
- data/src/core/telemetry/call_tracer.cc +20 -14
- data/src/core/telemetry/call_tracer.h +22 -17
- data/src/core/telemetry/metrics.h +8 -8
- data/src/core/telemetry/stats_data.cc +151 -151
- data/src/core/telemetry/stats_data.h +87 -87
- data/src/core/transport/auth_context.cc +20 -0
- data/src/core/transport/auth_context.h +4 -0
- data/src/core/transport/auth_context_comparator_registry.h +69 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +2 -3
- data/src/core/tsi/ssl_transport_security.cc +202 -32
- data/src/core/tsi/ssl_transport_security.h +19 -10
- data/src/core/tsi/ssl_transport_security_utils.cc +21 -0
- data/src/core/tsi/ssl_transport_security_utils.h +4 -0
- data/src/core/util/http_client/httpcli_security_connector.cc +3 -1
- data/src/core/util/latent_see.cc +178 -146
- data/src/core/util/latent_see.h +245 -188
- data/src/core/util/single_set_ptr.h +5 -2
- data/src/core/util/useful.h +91 -0
- data/src/core/util/windows/directory_reader.cc +1 -0
- data/src/core/util/windows/thd.cc +1 -3
- data/src/core/util/work_serializer.cc +1 -1
- data/src/core/xds/grpc/file_watcher_certificate_provider_factory.cc +32 -5
- data/src/core/xds/grpc/file_watcher_certificate_provider_factory.h +5 -0
- data/src/core/xds/grpc/xds_certificate_provider.cc +5 -6
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +1 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/third_party/cares/cares/include/ares.h +925 -460
- data/third_party/cares/cares/include/ares_dns.h +86 -71
- data/third_party/cares/cares/include/ares_dns_record.h +1118 -0
- data/third_party/cares/cares/include/ares_nameser.h +215 -189
- data/third_party/cares/cares/include/ares_version.h +37 -14
- data/third_party/cares/cares/src/lib/ares_addrinfo2hostent.c +305 -0
- data/third_party/cares/cares/src/lib/ares_addrinfo_localhost.c +245 -0
- data/third_party/cares/cares/src/lib/ares_android.c +216 -164
- data/third_party/cares/cares/src/lib/ares_android.h +25 -14
- data/third_party/cares/cares/src/lib/ares_cancel.c +68 -44
- data/third_party/cares/cares/src/lib/ares_close_sockets.c +137 -0
- data/third_party/cares/cares/src/lib/ares_conn.c +511 -0
- data/third_party/cares/cares/src/lib/ares_conn.h +196 -0
- data/third_party/cares/cares/src/lib/ares_cookie.c +461 -0
- data/third_party/cares/cares/src/lib/ares_data.c +93 -181
- data/third_party/cares/cares/src/lib/ares_data.h +50 -39
- data/third_party/cares/cares/src/lib/ares_destroy.c +127 -89
- data/third_party/cares/cares/src/lib/ares_free_hostent.c +35 -24
- data/third_party/cares/cares/src/lib/ares_free_string.c +24 -16
- data/third_party/cares/cares/src/lib/ares_freeaddrinfo.c +45 -38
- data/third_party/cares/cares/src/lib/ares_getaddrinfo.c +549 -663
- data/third_party/cares/cares/src/lib/ares_getenv.c +25 -15
- data/third_party/cares/cares/src/lib/ares_getenv.h +26 -18
- data/third_party/cares/cares/src/lib/ares_gethostbyaddr.c +163 -221
- data/third_party/cares/cares/src/lib/ares_gethostbyname.c +222 -223
- data/third_party/cares/cares/src/lib/ares_getnameinfo.c +328 -338
- data/third_party/cares/cares/src/lib/ares_hosts_file.c +952 -0
- data/third_party/cares/cares/src/lib/ares_inet_net_pton.h +25 -19
- data/third_party/cares/cares/src/lib/ares_init.c +425 -2091
- data/third_party/cares/cares/src/lib/ares_ipv6.h +63 -33
- data/third_party/cares/cares/src/lib/ares_library_init.c +110 -54
- data/third_party/cares/cares/src/lib/ares_metrics.c +261 -0
- data/third_party/cares/cares/src/lib/ares_options.c +418 -332
- data/third_party/cares/cares/src/lib/ares_parse_into_addrinfo.c +179 -0
- data/third_party/cares/cares/src/lib/ares_private.h +558 -356
- data/third_party/cares/cares/src/lib/ares_process.c +1224 -1369
- data/third_party/cares/cares/src/lib/ares_qcache.c +430 -0
- data/third_party/cares/cares/src/lib/ares_query.c +126 -121
- data/third_party/cares/cares/src/lib/ares_search.c +564 -262
- data/third_party/cares/cares/src/lib/ares_send.c +264 -93
- data/third_party/cares/cares/src/lib/ares_set_socket_functions.c +588 -0
- data/third_party/cares/cares/src/lib/ares_setup.h +115 -111
- data/third_party/cares/cares/src/lib/ares_socket.c +425 -0
- data/third_party/cares/cares/src/lib/ares_socket.h +163 -0
- data/third_party/cares/cares/src/lib/ares_sortaddrinfo.c +447 -0
- data/third_party/cares/cares/src/lib/ares_strerror.c +83 -48
- data/third_party/cares/cares/src/lib/ares_sysconfig.c +639 -0
- data/third_party/cares/cares/src/lib/ares_sysconfig_files.c +839 -0
- data/third_party/cares/cares/src/lib/ares_sysconfig_mac.c +373 -0
- data/third_party/cares/cares/src/lib/ares_sysconfig_win.c +621 -0
- data/third_party/cares/cares/src/lib/ares_timeout.c +136 -73
- data/third_party/cares/cares/src/lib/ares_update_servers.c +1362 -0
- data/third_party/cares/cares/src/lib/ares_version.c +29 -4
- data/third_party/cares/cares/src/lib/config-dos.h +88 -89
- data/third_party/cares/cares/src/lib/config-win32.h +122 -77
- data/third_party/cares/cares/src/lib/dsa/ares_array.c +394 -0
- data/third_party/cares/cares/src/lib/dsa/ares_htable.c +447 -0
- data/third_party/cares/cares/src/lib/dsa/ares_htable.h +174 -0
- data/third_party/cares/cares/src/lib/dsa/ares_htable_asvp.c +224 -0
- data/third_party/cares/cares/src/lib/dsa/ares_htable_dict.c +228 -0
- data/third_party/cares/cares/src/lib/dsa/ares_htable_strvp.c +210 -0
- data/third_party/cares/cares/src/lib/dsa/ares_htable_szvp.c +188 -0
- data/third_party/cares/cares/src/lib/dsa/ares_htable_vpstr.c +186 -0
- data/third_party/cares/cares/src/lib/dsa/ares_htable_vpvp.c +194 -0
- data/third_party/cares/cares/src/lib/dsa/ares_llist.c +382 -0
- data/third_party/cares/cares/src/lib/dsa/ares_slist.c +479 -0
- data/third_party/cares/cares/src/lib/dsa/ares_slist.h +207 -0
- data/third_party/cares/cares/src/lib/event/ares_event.h +191 -0
- data/third_party/cares/cares/src/lib/event/ares_event_configchg.c +743 -0
- data/third_party/cares/cares/src/lib/event/ares_event_epoll.c +192 -0
- data/third_party/cares/cares/src/lib/event/ares_event_kqueue.c +248 -0
- data/third_party/cares/cares/src/lib/event/ares_event_poll.c +140 -0
- data/third_party/cares/cares/src/lib/event/ares_event_select.c +159 -0
- data/third_party/cares/cares/src/lib/event/ares_event_thread.c +567 -0
- data/third_party/cares/cares/src/lib/event/ares_event_wake_pipe.c +166 -0
- data/third_party/cares/cares/src/lib/event/ares_event_win32.c +978 -0
- data/third_party/cares/cares/src/lib/event/ares_event_win32.h +161 -0
- data/third_party/cares/cares/src/lib/include/ares_array.h +276 -0
- data/third_party/cares/cares/src/lib/include/ares_buf.h +732 -0
- data/third_party/cares/cares/src/lib/include/ares_htable_asvp.h +130 -0
- data/third_party/cares/cares/src/lib/include/ares_htable_dict.h +123 -0
- data/third_party/cares/cares/src/lib/include/ares_htable_strvp.h +130 -0
- data/third_party/cares/cares/src/lib/include/ares_htable_szvp.h +118 -0
- data/third_party/cares/cares/src/lib/include/ares_htable_vpstr.h +111 -0
- data/third_party/cares/cares/src/lib/include/ares_htable_vpvp.h +128 -0
- data/third_party/cares/cares/src/lib/include/ares_llist.h +239 -0
- data/third_party/cares/cares/src/lib/include/ares_mem.h +38 -0
- data/third_party/cares/cares/src/lib/include/ares_str.h +244 -0
- data/third_party/cares/cares/src/lib/inet_net_pton.c +202 -157
- data/third_party/cares/cares/src/lib/inet_ntop.c +87 -69
- data/third_party/cares/cares/src/lib/legacy/ares_create_query.c +78 -0
- data/third_party/cares/cares/src/lib/legacy/ares_expand_name.c +99 -0
- data/third_party/cares/cares/src/lib/legacy/ares_expand_string.c +107 -0
- data/third_party/cares/cares/src/lib/legacy/ares_fds.c +80 -0
- data/third_party/cares/cares/src/lib/legacy/ares_getsock.c +85 -0
- data/third_party/cares/cares/src/lib/legacy/ares_parse_a_reply.c +107 -0
- data/third_party/cares/cares/src/lib/legacy/ares_parse_aaaa_reply.c +109 -0
- data/third_party/cares/cares/src/lib/legacy/ares_parse_caa_reply.c +137 -0
- data/third_party/cares/cares/src/lib/legacy/ares_parse_mx_reply.c +110 -0
- data/third_party/cares/cares/src/lib/legacy/ares_parse_naptr_reply.c +132 -0
- data/third_party/cares/cares/src/lib/legacy/ares_parse_ns_reply.c +154 -0
- data/third_party/cares/cares/src/lib/legacy/ares_parse_ptr_reply.c +213 -0
- data/third_party/cares/cares/src/lib/legacy/ares_parse_soa_reply.c +115 -0
- data/third_party/cares/cares/src/lib/legacy/ares_parse_srv_reply.c +114 -0
- data/third_party/cares/cares/src/lib/legacy/ares_parse_txt_reply.c +144 -0
- data/third_party/cares/cares/src/lib/legacy/ares_parse_uri_reply.c +113 -0
- data/third_party/cares/cares/src/lib/record/ares_dns_mapping.c +982 -0
- data/third_party/cares/cares/src/lib/record/ares_dns_multistring.c +307 -0
- data/third_party/cares/cares/src/lib/record/ares_dns_multistring.h +72 -0
- data/third_party/cares/cares/src/lib/record/ares_dns_name.c +673 -0
- data/third_party/cares/cares/src/lib/record/ares_dns_parse.c +1329 -0
- data/third_party/cares/cares/src/lib/record/ares_dns_private.h +273 -0
- data/third_party/cares/cares/src/lib/record/ares_dns_record.c +1661 -0
- data/third_party/cares/cares/src/lib/record/ares_dns_write.c +1229 -0
- data/third_party/cares/cares/src/lib/str/ares_buf.c +1498 -0
- data/third_party/cares/cares/src/lib/str/ares_str.c +508 -0
- data/third_party/cares/cares/src/lib/str/ares_strsplit.c +90 -0
- data/third_party/cares/cares/src/lib/str/ares_strsplit.h +51 -0
- data/third_party/cares/cares/src/lib/thirdparty/apple/dnsinfo.h +122 -0
- data/third_party/cares/cares/src/lib/util/ares_iface_ips.c +628 -0
- data/third_party/cares/cares/src/lib/util/ares_iface_ips.h +139 -0
- data/third_party/cares/cares/src/lib/util/ares_math.c +158 -0
- data/third_party/cares/cares/src/lib/util/ares_math.h +45 -0
- data/third_party/cares/cares/src/lib/util/ares_rand.c +389 -0
- data/third_party/cares/cares/src/lib/util/ares_rand.h +36 -0
- data/third_party/cares/cares/src/lib/util/ares_threads.c +614 -0
- data/third_party/cares/cares/src/lib/util/ares_threads.h +60 -0
- data/third_party/cares/cares/src/lib/util/ares_time.h +48 -0
- data/third_party/cares/cares/src/lib/util/ares_timeval.c +95 -0
- data/third_party/cares/cares/src/lib/util/ares_uri.c +1626 -0
- data/third_party/cares/cares/src/lib/util/ares_uri.h +252 -0
- data/third_party/cares/cares/src/lib/windows_port.c +16 -9
- metadata +121 -49
- data/src/core/util/ring_buffer.h +0 -122
- data/third_party/cares/cares/include/ares_rules.h +0 -125
- data/third_party/cares/cares/src/lib/ares__addrinfo2hostent.c +0 -266
- data/third_party/cares/cares/src/lib/ares__addrinfo_localhost.c +0 -240
- data/third_party/cares/cares/src/lib/ares__close_sockets.c +0 -61
- data/third_party/cares/cares/src/lib/ares__get_hostent.c +0 -260
- data/third_party/cares/cares/src/lib/ares__parse_into_addrinfo.c +0 -229
- data/third_party/cares/cares/src/lib/ares__read_line.c +0 -73
- data/third_party/cares/cares/src/lib/ares__readaddrinfo.c +0 -258
- data/third_party/cares/cares/src/lib/ares__sortaddrinfo.c +0 -507
- data/third_party/cares/cares/src/lib/ares__timeval.c +0 -111
- data/third_party/cares/cares/src/lib/ares_create_query.c +0 -197
- data/third_party/cares/cares/src/lib/ares_expand_name.c +0 -311
- data/third_party/cares/cares/src/lib/ares_expand_string.c +0 -67
- data/third_party/cares/cares/src/lib/ares_fds.c +0 -59
- data/third_party/cares/cares/src/lib/ares_getsock.c +0 -66
- data/third_party/cares/cares/src/lib/ares_iphlpapi.h +0 -221
- data/third_party/cares/cares/src/lib/ares_llist.c +0 -63
- data/third_party/cares/cares/src/lib/ares_llist.h +0 -39
- data/third_party/cares/cares/src/lib/ares_mkquery.c +0 -24
- data/third_party/cares/cares/src/lib/ares_nowarn.c +0 -260
- data/third_party/cares/cares/src/lib/ares_nowarn.h +0 -61
- data/third_party/cares/cares/src/lib/ares_parse_a_reply.c +0 -90
- data/third_party/cares/cares/src/lib/ares_parse_aaaa_reply.c +0 -92
- data/third_party/cares/cares/src/lib/ares_parse_caa_reply.c +0 -199
- data/third_party/cares/cares/src/lib/ares_parse_mx_reply.c +0 -164
- data/third_party/cares/cares/src/lib/ares_parse_naptr_reply.c +0 -183
- data/third_party/cares/cares/src/lib/ares_parse_ns_reply.c +0 -177
- data/third_party/cares/cares/src/lib/ares_parse_ptr_reply.c +0 -228
- data/third_party/cares/cares/src/lib/ares_parse_soa_reply.c +0 -179
- data/third_party/cares/cares/src/lib/ares_parse_srv_reply.c +0 -168
- data/third_party/cares/cares/src/lib/ares_parse_txt_reply.c +0 -214
- data/third_party/cares/cares/src/lib/ares_parse_uri_reply.c +0 -184
- data/third_party/cares/cares/src/lib/ares_platform.c +0 -11042
- data/third_party/cares/cares/src/lib/ares_platform.h +0 -43
- data/third_party/cares/cares/src/lib/ares_rand.c +0 -279
- data/third_party/cares/cares/src/lib/ares_strcasecmp.c +0 -66
- data/third_party/cares/cares/src/lib/ares_strcasecmp.h +0 -30
- data/third_party/cares/cares/src/lib/ares_strdup.c +0 -42
- data/third_party/cares/cares/src/lib/ares_strdup.h +0 -24
- data/third_party/cares/cares/src/lib/ares_strsplit.c +0 -94
- data/third_party/cares/cares/src/lib/ares_strsplit.h +0 -42
- data/third_party/cares/cares/src/lib/ares_writev.c +0 -79
- data/third_party/cares/cares/src/lib/ares_writev.h +0 -36
- data/third_party/cares/cares/src/lib/bitncmp.c +0 -59
- data/third_party/cares/cares/src/lib/bitncmp.h +0 -26
- data/third_party/cares/cares/src/lib/setup_once.h +0 -554
- data/third_party/cares/cares/src/tools/ares_getopt.h +0 -53
@@ -1,437 +1,639 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
*
|
1
|
+
/* MIT License
|
2
|
+
*
|
3
|
+
* Copyright (c) 1998 Massachusetts Institute of Technology
|
4
|
+
* Copyright (c) 2010 Daniel Stenberg
|
5
|
+
*
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
11
|
+
* furnished to do so, subject to the following conditions:
|
7
12
|
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
15
|
-
*
|
16
|
-
*
|
17
|
-
*
|
18
|
-
*
|
13
|
+
* The above copyright notice and this permission notice (including the next
|
14
|
+
* paragraph) shall be included in all copies or substantial portions of the
|
15
|
+
* Software.
|
16
|
+
*
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
|
+
* SOFTWARE.
|
24
|
+
*
|
25
|
+
* SPDX-License-Identifier: MIT
|
19
26
|
*/
|
27
|
+
#ifndef __ARES_PRIVATE_H
|
28
|
+
#define __ARES_PRIVATE_H
|
20
29
|
|
21
|
-
/*
|
22
|
-
*
|
30
|
+
/* ============================================================================
|
31
|
+
* NOTE: All c-ares source files should include ares_private.h as the first
|
32
|
+
* header.
|
33
|
+
* ============================================================================
|
23
34
|
*/
|
24
35
|
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#endif
|
36
|
+
#include "ares_setup.h"
|
37
|
+
#include "ares.h"
|
28
38
|
|
29
39
|
#ifdef HAVE_NETINET_IN_H
|
30
|
-
#include <netinet/in.h>
|
40
|
+
# include <netinet/in.h>
|
31
41
|
#endif
|
32
42
|
|
33
|
-
#
|
34
|
-
#include
|
35
|
-
#include
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
43
|
+
#include "ares_mem.h"
|
44
|
+
#include "ares_ipv6.h"
|
45
|
+
#include "util/ares_math.h"
|
46
|
+
#include "util/ares_time.h"
|
47
|
+
#include "util/ares_rand.h"
|
48
|
+
#include "ares_array.h"
|
49
|
+
#include "ares_llist.h"
|
50
|
+
#include "dsa/ares_slist.h"
|
51
|
+
#include "ares_htable_strvp.h"
|
52
|
+
#include "ares_htable_szvp.h"
|
53
|
+
#include "ares_htable_asvp.h"
|
54
|
+
#include "ares_htable_dict.h"
|
55
|
+
#include "ares_htable_vpvp.h"
|
56
|
+
#include "ares_htable_vpstr.h"
|
57
|
+
#include "record/ares_dns_multistring.h"
|
58
|
+
#include "ares_buf.h"
|
59
|
+
#include "record/ares_dns_private.h"
|
60
|
+
#include "util/ares_iface_ips.h"
|
61
|
+
#include "util/ares_threads.h"
|
62
|
+
#include "ares_socket.h"
|
63
|
+
#include "ares_conn.h"
|
64
|
+
#include "ares_str.h"
|
65
|
+
#include "str/ares_strsplit.h"
|
66
|
+
#include "util/ares_uri.h"
|
39
67
|
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#define INADDR_NONE 0xffffffff
|
68
|
+
#ifndef HAVE_GETENV
|
69
|
+
# include "ares_getenv.h"
|
70
|
+
# define getenv(ptr) ares_getenv(ptr)
|
44
71
|
#endif
|
45
72
|
|
46
|
-
#
|
47
|
-
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#define STATIC_TESTABLE static
|
73
|
+
#define DEFAULT_TIMEOUT 2000 /* milliseconds */
|
74
|
+
#define DEFAULT_TRIES 3
|
75
|
+
#ifndef INADDR_NONE
|
76
|
+
# define INADDR_NONE 0xffffffff
|
51
77
|
#endif
|
52
78
|
|
53
79
|
/* By using a double cast, we can get rid of the bogus warning of
|
54
|
-
* warning: cast from 'const struct sockaddr *' to 'const struct sockaddr_in6 *'
|
80
|
+
* warning: cast from 'const struct sockaddr *' to 'const struct sockaddr_in6 *'
|
81
|
+
* increases required alignment from 1 to 4 [-Wcast-align]
|
55
82
|
*/
|
56
|
-
#define CARES_INADDR_CAST(type, var) ((type)((void *)var))
|
57
|
-
|
58
|
-
#if defined(
|
59
|
-
|
60
|
-
#define WIN_NS_9X
|
61
|
-
#define WIN_NS_NT_KEY
|
62
|
-
#define WIN_DNSCLIENT
|
63
|
-
#define WIN_NT_DNSCLIENT
|
64
|
-
|
65
|
-
#define
|
66
|
-
#define
|
67
|
-
#define
|
68
|
-
#define
|
69
|
-
#define
|
70
|
-
#define
|
71
|
-
#define
|
72
|
-
#define
|
73
|
-
|
83
|
+
#define CARES_INADDR_CAST(type, var) ((type)((const void *)var))
|
84
|
+
|
85
|
+
#if defined(USE_WINSOCK)
|
86
|
+
|
87
|
+
# define WIN_NS_9X "System\\CurrentControlSet\\Services\\VxD\\MSTCP"
|
88
|
+
# define WIN_NS_NT_KEY "System\\CurrentControlSet\\Services\\Tcpip\\Parameters"
|
89
|
+
# define WIN_DNSCLIENT "Software\\Policies\\Microsoft\\System\\DNSClient"
|
90
|
+
# define WIN_NT_DNSCLIENT \
|
91
|
+
"Software\\Policies\\Microsoft\\Windows NT\\DNSClient"
|
92
|
+
# define NAMESERVER "NameServer"
|
93
|
+
# define DHCPNAMESERVER "DhcpNameServer"
|
94
|
+
# define DATABASEPATH "DatabasePath"
|
95
|
+
# define WIN_PATH_HOSTS "\\hosts"
|
96
|
+
# define SEARCHLIST_KEY "SearchList"
|
97
|
+
# define PRIMARYDNSSUFFIX_KEY "PrimaryDNSSuffix"
|
98
|
+
# define INTERFACES_KEY "Interfaces"
|
99
|
+
# define DOMAIN_KEY "Domain"
|
100
|
+
# define DHCPDOMAIN_KEY "DhcpDomain"
|
101
|
+
# define PATH_RESOLV_CONF ""
|
74
102
|
#elif defined(WATT32)
|
75
103
|
|
76
|
-
#define PATH_RESOLV_CONF "/dev/ENV/etc/resolv.conf"
|
77
|
-
W32_FUNC const char *_w32_GetHostsFile
|
104
|
+
# define PATH_RESOLV_CONF "/dev/ENV/etc/resolv.conf"
|
105
|
+
W32_FUNC const char *_w32_GetHostsFile(void);
|
78
106
|
|
79
107
|
#elif defined(NETWARE)
|
80
108
|
|
81
|
-
#define PATH_RESOLV_CONF "sys:/etc/resolv.cfg"
|
82
|
-
#define PATH_HOSTS
|
109
|
+
# define PATH_RESOLV_CONF "sys:/etc/resolv.cfg"
|
110
|
+
# define PATH_HOSTS "sys:/etc/hosts"
|
83
111
|
|
84
112
|
#elif defined(__riscos__)
|
85
113
|
|
86
|
-
#define
|
114
|
+
# define PATH_RESOLV_CONF ""
|
115
|
+
# define PATH_HOSTS "InetDBase:Hosts"
|
87
116
|
|
88
117
|
#elif defined(__HAIKU__)
|
89
118
|
|
90
|
-
#define PATH_RESOLV_CONF "/system/settings/network/resolv.conf"
|
91
|
-
#define PATH_HOSTS
|
119
|
+
# define PATH_RESOLV_CONF "/system/settings/network/resolv.conf"
|
120
|
+
# define PATH_HOSTS "/system/settings/network/hosts"
|
92
121
|
|
93
122
|
#else
|
94
123
|
|
95
|
-
#define PATH_RESOLV_CONF
|
96
|
-
#ifdef ETC_INET
|
97
|
-
#define PATH_HOSTS
|
98
|
-
#else
|
99
|
-
#define PATH_HOSTS
|
100
|
-
#endif
|
124
|
+
# define PATH_RESOLV_CONF "/etc/resolv.conf"
|
125
|
+
# ifdef ETC_INET
|
126
|
+
# define PATH_HOSTS "/etc/inet/hosts"
|
127
|
+
# else
|
128
|
+
# define PATH_HOSTS "/etc/hosts"
|
129
|
+
# endif
|
101
130
|
|
102
131
|
#endif
|
103
132
|
|
104
|
-
#include "ares_ipv6.h"
|
105
|
-
#include "ares_llist.h"
|
106
|
-
|
107
|
-
#ifndef HAVE_GETENV
|
108
|
-
# include "ares_getenv.h"
|
109
|
-
# define getenv(ptr) ares_getenv(ptr)
|
110
|
-
#endif
|
111
|
-
|
112
|
-
#include "ares_strdup.h"
|
113
|
-
#include "ares_strsplit.h"
|
114
|
-
|
115
|
-
#ifndef HAVE_STRCASECMP
|
116
|
-
# include "ares_strcasecmp.h"
|
117
|
-
# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
|
118
|
-
#endif
|
119
|
-
|
120
|
-
#ifndef HAVE_STRNCASECMP
|
121
|
-
# include "ares_strcasecmp.h"
|
122
|
-
# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
|
123
|
-
#endif
|
124
|
-
|
125
|
-
#ifndef HAVE_WRITEV
|
126
|
-
# include "ares_writev.h"
|
127
|
-
# define writev(s,ptr,cnt) ares_writev(s,ptr,cnt)
|
128
|
-
#endif
|
129
|
-
|
130
|
-
/********* EDNS defines section ******/
|
131
|
-
#define EDNSPACKETSZ 1280 /* Reasonable UDP payload size, as suggested
|
132
|
-
in RFC2671 */
|
133
|
-
#define MAXENDSSZ 4096 /* Maximum (local) limit for edns packet size */
|
134
|
-
#define EDNSFIXEDSZ 11 /* Size of EDNS header */
|
135
133
|
/********* EDNS defines section ******/
|
134
|
+
#define EDNSPACKETSZ \
|
135
|
+
1232 /* Reasonable UDP payload size, as agreed by operators \
|
136
|
+
https://www.dnsflagday.net/2020/#faq */
|
137
|
+
#define MAXENDSSZ 4096 /* Maximum (local) limit for edns packet size */
|
138
|
+
#define EDNSFIXEDSZ 11 /* Size of EDNS header */
|
136
139
|
|
137
|
-
|
138
|
-
int family;
|
139
|
-
union {
|
140
|
-
struct in_addr addr4;
|
141
|
-
struct ares_in6_addr addr6;
|
142
|
-
} addr;
|
143
|
-
int udp_port; /* stored in network order */
|
144
|
-
int tcp_port; /* stored in network order */
|
145
|
-
};
|
146
|
-
#define addrV4 addr.addr4
|
147
|
-
#define addrV6 addr.addr6
|
148
|
-
|
149
|
-
struct query;
|
150
|
-
|
151
|
-
struct send_request {
|
152
|
-
/* Remaining data to send */
|
153
|
-
const unsigned char *data;
|
154
|
-
size_t len;
|
155
|
-
|
156
|
-
/* The query for which we're sending this data */
|
157
|
-
struct query* owner_query;
|
158
|
-
/* The buffer we're using, if we have our own copy of the packet */
|
159
|
-
unsigned char *data_storage;
|
160
|
-
|
161
|
-
/* Next request in queue */
|
162
|
-
struct send_request *next;
|
163
|
-
};
|
164
|
-
|
165
|
-
struct server_state {
|
166
|
-
struct ares_addr addr;
|
167
|
-
ares_socket_t udp_socket;
|
168
|
-
ares_socket_t tcp_socket;
|
169
|
-
|
170
|
-
/* Mini-buffer for reading the length word */
|
171
|
-
unsigned char tcp_lenbuf[2];
|
172
|
-
int tcp_lenbuf_pos;
|
173
|
-
int tcp_length;
|
174
|
-
|
175
|
-
/* Buffer for reading actual TCP data */
|
176
|
-
unsigned char *tcp_buffer;
|
177
|
-
int tcp_buffer_pos;
|
178
|
-
|
179
|
-
/* TCP output queue */
|
180
|
-
struct send_request *qhead;
|
181
|
-
struct send_request *qtail;
|
182
|
-
|
183
|
-
/* Which incarnation of this connection is this? We don't want to
|
184
|
-
* retransmit requests into the very same socket, but if the server
|
185
|
-
* closes on us and we re-open the connection, then we do want to
|
186
|
-
* re-send. */
|
187
|
-
int tcp_connection_generation;
|
188
|
-
|
189
|
-
/* Circular, doubly-linked list of outstanding queries to this server */
|
190
|
-
struct list_node queries_to_server;
|
140
|
+
/********* EDNS defines section ******/
|
191
141
|
|
192
|
-
|
193
|
-
|
142
|
+
/* Default values for server failover behavior. We retry failed servers with
|
143
|
+
* a 10% probability and a minimum delay of 5 seconds between retries.
|
144
|
+
*/
|
145
|
+
#define DEFAULT_SERVER_RETRY_CHANCE 10
|
146
|
+
#define DEFAULT_SERVER_RETRY_DELAY 5000
|
194
147
|
|
195
|
-
|
196
|
-
|
197
|
-
*/
|
198
|
-
int is_broken;
|
199
|
-
};
|
148
|
+
struct ares_query;
|
149
|
+
typedef struct ares_query ares_query_t;
|
200
150
|
|
201
151
|
/* State to represent a DNS query */
|
202
|
-
struct
|
152
|
+
struct ares_query {
|
203
153
|
/* Query ID from qbuf, for faster lookup, and current timeout */
|
204
|
-
unsigned short
|
205
|
-
|
154
|
+
unsigned short qid; /* host byte order */
|
155
|
+
ares_timeval_t ts; /*!< Timestamp query was sent */
|
156
|
+
ares_timeval_t timeout;
|
157
|
+
ares_channel_t *channel;
|
206
158
|
|
207
159
|
/*
|
208
|
-
*
|
209
|
-
*
|
210
|
-
* the attributes we care about, help making most important
|
211
|
-
* operations O(1).
|
160
|
+
* Node object for each list entry the query belongs to in order to
|
161
|
+
* make removal operations O(1).
|
212
162
|
*/
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
struct list_node all_queries;
|
163
|
+
ares_slist_node_t *node_queries_by_timeout;
|
164
|
+
ares_llist_node_t *node_queries_to_conn;
|
165
|
+
ares_llist_node_t *node_all_queries;
|
217
166
|
|
218
|
-
/*
|
219
|
-
|
220
|
-
int tcplen;
|
167
|
+
/* connection handle query is associated with */
|
168
|
+
ares_conn_t *conn;
|
221
169
|
|
222
|
-
/*
|
223
|
-
|
224
|
-
int qlen;
|
225
|
-
ares_callback callback;
|
226
|
-
void *arg;
|
170
|
+
/* Query */
|
171
|
+
ares_dns_record_t *query;
|
227
172
|
|
228
|
-
|
229
|
-
|
230
|
-
int server; /* Server this query has last been sent to. */
|
231
|
-
struct query_server_info *server_info; /* per-server state */
|
232
|
-
int using_tcp;
|
233
|
-
int error_status;
|
234
|
-
int timeouts; /* number of timeouts we saw for this request */
|
235
|
-
};
|
173
|
+
ares_callback_dnsrec callback;
|
174
|
+
void *arg;
|
236
175
|
|
237
|
-
/*
|
238
|
-
|
239
|
-
|
240
|
-
|
176
|
+
/* Query status */
|
177
|
+
size_t try_count; /* Number of times we tried this query already. */
|
178
|
+
size_t cookie_try_count; /* Attempt count for cookie resends */
|
179
|
+
ares_bool_t using_tcp;
|
180
|
+
ares_status_t error_status;
|
181
|
+
size_t timeouts; /* number of timeouts we saw for this request */
|
182
|
+
ares_bool_t no_retries; /* do not perform any additional retries, this is
|
183
|
+
* set when a query is to be canceled */
|
241
184
|
};
|
242
185
|
|
243
|
-
/* An IP address pattern; matches an IP address X if X & mask == addr */
|
244
|
-
#define PATTERN_MASK 0x1
|
245
|
-
#define PATTERN_CIDR 0x2
|
246
|
-
|
247
186
|
struct apattern {
|
248
|
-
|
249
|
-
|
250
|
-
struct in_addr addr4;
|
251
|
-
struct ares_in6_addr addr6;
|
252
|
-
} addr;
|
253
|
-
union
|
254
|
-
{
|
255
|
-
struct in_addr addr4;
|
256
|
-
struct ares_in6_addr addr6;
|
257
|
-
unsigned short bits;
|
258
|
-
} mask;
|
259
|
-
int family;
|
260
|
-
unsigned short type;
|
187
|
+
struct ares_addr addr;
|
188
|
+
unsigned char mask;
|
261
189
|
};
|
262
190
|
|
263
|
-
struct
|
264
|
-
typedef struct
|
191
|
+
struct ares_qcache;
|
192
|
+
typedef struct ares_qcache ares_qcache_t;
|
193
|
+
|
194
|
+
struct ares_hosts_file;
|
195
|
+
typedef struct ares_hosts_file ares_hosts_file_t;
|
265
196
|
|
266
197
|
struct ares_channeldata {
|
267
198
|
/* Configuration data */
|
268
|
-
int
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
int
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
199
|
+
unsigned int flags;
|
200
|
+
size_t timeout; /* in milliseconds */
|
201
|
+
size_t tries;
|
202
|
+
size_t ndots;
|
203
|
+
size_t maxtimeout; /* in milliseconds */
|
204
|
+
ares_bool_t rotate;
|
205
|
+
unsigned short udp_port; /* stored in network order */
|
206
|
+
unsigned short tcp_port; /* stored in network order */
|
207
|
+
int socket_send_buffer_size; /* setsockopt takes int */
|
208
|
+
int socket_receive_buffer_size; /* setsockopt takes int */
|
209
|
+
char **domains;
|
210
|
+
size_t ndomains;
|
211
|
+
struct apattern *sortlist;
|
212
|
+
size_t nsort;
|
213
|
+
char *lookups;
|
214
|
+
size_t ednspsz;
|
215
|
+
unsigned int qcache_max_ttl;
|
216
|
+
ares_evsys_t evsys;
|
217
|
+
unsigned int optmask;
|
283
218
|
|
284
219
|
/* For binding to local devices and/or IP addresses. Leave
|
285
220
|
* them null/zero for no binding.
|
286
221
|
*/
|
287
|
-
char
|
288
|
-
unsigned int
|
289
|
-
unsigned char
|
290
|
-
|
291
|
-
int optmask; /* the option bitfield passed in at init time */
|
292
|
-
|
293
|
-
/* Server addresses and communications state */
|
294
|
-
struct server_state *servers;
|
295
|
-
int nservers;
|
222
|
+
char local_dev_name[32];
|
223
|
+
unsigned int local_ip4;
|
224
|
+
unsigned char local_ip6[16];
|
296
225
|
|
297
|
-
/*
|
298
|
-
|
299
|
-
/* random state to use when generating new ids */
|
300
|
-
ares_rand_state *rand_state;
|
226
|
+
/* Thread safety lock */
|
227
|
+
ares_thread_mutex_t *lock;
|
301
228
|
|
302
|
-
/*
|
303
|
-
|
229
|
+
/* Conditional to wake waiters when queue is empty */
|
230
|
+
ares_thread_cond_t *cond_empty;
|
304
231
|
|
305
|
-
/*
|
306
|
-
|
307
|
-
|
232
|
+
/* Server addresses and communications state. Sorted by least consecutive
|
233
|
+
* failures, followed by the configuration order if failures are equal. */
|
234
|
+
ares_slist_t *servers;
|
308
235
|
|
309
|
-
/*
|
310
|
-
|
236
|
+
/* random state to use when generating new ids and generating retry penalties
|
237
|
+
*/
|
238
|
+
ares_rand_state *rand_state;
|
311
239
|
|
312
|
-
/*
|
313
|
-
|
314
|
-
struct list_node all_queries;
|
240
|
+
/* All active queries in a single list */
|
241
|
+
ares_llist_t *all_queries;
|
315
242
|
/* Queries bucketed by qid, for quickly dispatching DNS responses: */
|
316
|
-
|
317
|
-
|
243
|
+
ares_htable_szvp_t *queries_by_qid;
|
244
|
+
|
318
245
|
/* Queries bucketed by timeout, for quickly handling timeouts: */
|
319
|
-
|
320
|
-
|
246
|
+
ares_slist_t *queries_by_timeout;
|
247
|
+
|
248
|
+
/* Map linked list node member for connection to file descriptor. We use
|
249
|
+
* the node instead of the connection object itself so we can quickly look
|
250
|
+
* up a connection and remove it if necessary (as otherwise we'd have to
|
251
|
+
* scan all connections) */
|
252
|
+
ares_htable_asvp_t *connnode_by_socket;
|
321
253
|
|
322
|
-
ares_sock_state_cb
|
323
|
-
void
|
254
|
+
ares_sock_state_cb sock_state_cb;
|
255
|
+
void *sock_state_cb_data;
|
324
256
|
|
325
|
-
ares_sock_create_callback
|
326
|
-
void
|
257
|
+
ares_sock_create_callback sock_create_cb;
|
258
|
+
void *sock_create_cb_data;
|
327
259
|
|
328
|
-
ares_sock_config_callback
|
329
|
-
void
|
260
|
+
ares_sock_config_callback sock_config_cb;
|
261
|
+
void *sock_config_cb_data;
|
330
262
|
|
331
|
-
|
332
|
-
void
|
263
|
+
struct ares_socket_functions_ex sock_funcs;
|
264
|
+
void *sock_func_cb_data;
|
265
|
+
const struct ares_socket_functions *legacy_sock_funcs;
|
266
|
+
void *legacy_sock_funcs_cb_data;
|
267
|
+
|
268
|
+
ares_pending_write_cb notify_pending_write_cb;
|
269
|
+
void *notify_pending_write_cb_data;
|
270
|
+
ares_bool_t notify_pending_write;
|
333
271
|
|
334
272
|
/* Path for resolv.conf file, configurable via ares_options */
|
335
|
-
char
|
273
|
+
char *resolvconf_path;
|
336
274
|
|
337
275
|
/* Path for hosts file, configurable via ares_options */
|
338
|
-
char
|
276
|
+
char *hosts_path;
|
277
|
+
|
278
|
+
/* Maximum UDP queries per connection allowed */
|
279
|
+
size_t udp_max_queries;
|
280
|
+
|
281
|
+
/* Cache of local hosts file */
|
282
|
+
ares_hosts_file_t *hf;
|
283
|
+
|
284
|
+
/* Query Cache */
|
285
|
+
ares_qcache_t *qcache;
|
286
|
+
|
287
|
+
/* Fields controlling server failover behavior.
|
288
|
+
* The retry chance is the probability (1/N) by which we will retry a failed
|
289
|
+
* server instead of the best server when selecting a server to send queries
|
290
|
+
* to.
|
291
|
+
* The retry delay is the minimum time in milliseconds to wait between doing
|
292
|
+
* such retries (applied per-server).
|
293
|
+
*/
|
294
|
+
unsigned short server_retry_chance;
|
295
|
+
size_t server_retry_delay;
|
296
|
+
|
297
|
+
/* Callback triggered when a server has a successful or failed response */
|
298
|
+
ares_server_state_callback server_state_cb;
|
299
|
+
void *server_state_cb_data;
|
300
|
+
|
301
|
+
/* TRUE if a reinit is pending. Reinit spawns a thread to read the system
|
302
|
+
* configuration and then apply the configuration since configuration
|
303
|
+
* reading may block. The thread handle is provided for waiting on thread
|
304
|
+
* exit. */
|
305
|
+
ares_bool_t reinit_pending;
|
306
|
+
ares_thread_t *reinit_thread;
|
307
|
+
|
308
|
+
/* Whether the system is up or not. This is mainly to prevent deadlocks
|
309
|
+
* and access violations during the cleanup process. Some things like
|
310
|
+
* system config changes might get triggered and we need a flag to make
|
311
|
+
* sure we don't take action. */
|
312
|
+
ares_bool_t sys_up;
|
339
313
|
};
|
340
314
|
|
341
315
|
/* Does the domain end in ".onion" or ".onion."? Case-insensitive. */
|
342
|
-
|
343
|
-
|
344
|
-
/*
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
int
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
316
|
+
ares_bool_t ares_is_onion_domain(const char *name);
|
317
|
+
|
318
|
+
/* Returns one of the normal ares status codes like ARES_SUCCESS */
|
319
|
+
ares_status_t ares_send_query(ares_server_t *requested_server /* Optional */,
|
320
|
+
ares_query_t *query, const ares_timeval_t *now);
|
321
|
+
ares_status_t ares_requeue_query(ares_query_t *query, const ares_timeval_t *now,
|
322
|
+
ares_status_t status,
|
323
|
+
ares_bool_t inc_try_count,
|
324
|
+
const ares_dns_record_t *dnsrec,
|
325
|
+
ares_array_t **requeue);
|
326
|
+
|
327
|
+
/*! Count the number of labels (dots+1) in a domain */
|
328
|
+
size_t ares_name_label_cnt(const char *name);
|
329
|
+
|
330
|
+
/*! Retrieve a list of names to use for searching. The first successful
|
331
|
+
* query in the list wins. This function also uses the HOSTSALIASES file
|
332
|
+
* as well as uses channel configuration to determine the search order.
|
333
|
+
*
|
334
|
+
* \param[in] channel initialized ares channel
|
335
|
+
* \param[in] name initial name being searched
|
336
|
+
* \param[out] names array of names to attempt, use ares_strsplit_free()
|
337
|
+
* when no longer needed.
|
338
|
+
* \param[out] names_len number of names in array
|
339
|
+
* \return ARES_SUCCESS on success, otherwise one of the other error codes.
|
340
|
+
*/
|
341
|
+
ares_status_t ares_search_name_list(const ares_channel_t *channel,
|
342
|
+
const char *name, char ***names,
|
343
|
+
size_t *names_len);
|
344
|
+
|
345
|
+
/*! Function to create callback arg for converting from ares_callback_dnsrec
|
346
|
+
* to ares_calback */
|
347
|
+
void *ares_dnsrec_convert_arg(ares_callback callback, void *arg);
|
348
|
+
|
349
|
+
/*! Callback function used to convert from the ares_callback_dnsrec prototype to
|
350
|
+
* the ares_callback prototype, by writing the result and passing that to
|
351
|
+
* the inner callback.
|
352
|
+
*/
|
353
|
+
void ares_dnsrec_convert_cb(void *arg, ares_status_t status, size_t timeouts,
|
354
|
+
const ares_dns_record_t *dnsrec);
|
355
|
+
|
356
|
+
void ares_free_query(ares_query_t *query);
|
357
|
+
|
358
|
+
unsigned short ares_generate_new_id(ares_rand_state *state);
|
359
|
+
ares_status_t ares_expand_name_validated(const unsigned char *encoded,
|
360
|
+
const unsigned char *abuf, size_t alen,
|
361
|
+
char **s, size_t *enclen,
|
362
|
+
ares_bool_t is_hostname);
|
363
|
+
ares_status_t ares_expand_string_ex(const unsigned char *encoded,
|
364
|
+
const unsigned char *abuf, size_t alen,
|
365
|
+
unsigned char **s, size_t *enclen);
|
366
|
+
ares_status_t ares_init_servers_state(ares_channel_t *channel);
|
367
|
+
ares_status_t ares_init_by_options(ares_channel_t *channel,
|
368
|
+
const struct ares_options *options,
|
369
|
+
int optmask);
|
370
|
+
ares_status_t ares_init_by_sysconfig(ares_channel_t *channel);
|
371
|
+
void ares_set_socket_functions_def(ares_channel_t *channel);
|
372
|
+
|
373
|
+
typedef struct {
|
374
|
+
ares_llist_t *sconfig;
|
375
|
+
struct apattern *sortlist;
|
376
|
+
size_t nsortlist;
|
377
|
+
char **domains;
|
378
|
+
size_t ndomains;
|
379
|
+
char *lookups;
|
380
|
+
size_t ndots;
|
381
|
+
size_t tries;
|
382
|
+
ares_bool_t rotate;
|
383
|
+
size_t timeout_ms;
|
384
|
+
ares_bool_t usevc;
|
385
|
+
} ares_sysconfig_t;
|
386
|
+
|
387
|
+
ares_status_t ares_sysconfig_set_options(ares_sysconfig_t *sysconfig,
|
388
|
+
const char *str);
|
389
|
+
|
390
|
+
ares_status_t ares_init_by_environment(ares_sysconfig_t *sysconfig);
|
391
|
+
|
392
|
+
|
393
|
+
typedef ares_status_t (*ares_sysconfig_line_cb_t)(const ares_channel_t *channel,
|
394
|
+
ares_sysconfig_t *sysconfig,
|
395
|
+
ares_buf_t *line);
|
396
|
+
|
397
|
+
ares_status_t ares_sysconfig_parse_resolv_line(const ares_channel_t *channel,
|
398
|
+
ares_sysconfig_t *sysconfig,
|
399
|
+
ares_buf_t *line);
|
400
|
+
|
401
|
+
ares_status_t ares_sysconfig_process_buf(const ares_channel_t *channel,
|
402
|
+
ares_sysconfig_t *sysconfig,
|
403
|
+
ares_buf_t *buf,
|
404
|
+
ares_sysconfig_line_cb_t cb);
|
405
|
+
|
406
|
+
ares_status_t ares_init_sysconfig_files(const ares_channel_t *channel,
|
407
|
+
ares_sysconfig_t *sysconfig,
|
408
|
+
ares_bool_t process_resolvconf);
|
409
|
+
#ifdef __APPLE__
|
410
|
+
ares_status_t ares_init_sysconfig_macos(const ares_channel_t *channel,
|
411
|
+
ares_sysconfig_t *sysconfig);
|
412
|
+
#endif
|
413
|
+
#ifdef USE_WINSOCK
|
414
|
+
ares_status_t ares_init_sysconfig_windows(const ares_channel_t *channel,
|
415
|
+
ares_sysconfig_t *sysconfig);
|
418
416
|
#endif
|
419
417
|
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
418
|
+
ares_status_t ares_parse_sortlist(struct apattern **sortlist, size_t *nsort,
|
419
|
+
const char *str);
|
420
|
+
|
421
|
+
/* Returns ARES_SUCCESS if alias found, alias is set. Returns ARES_ENOTFOUND
|
422
|
+
* if not alias found. Returns other errors on critical failure like
|
423
|
+
* ARES_ENOMEM */
|
424
|
+
ares_status_t ares_lookup_hostaliases(const ares_channel_t *channel,
|
425
|
+
const char *name, char **alias);
|
426
|
+
|
427
|
+
ares_status_t ares_cat_domain(const char *name, const char *domain, char **s);
|
428
|
+
ares_status_t ares_sortaddrinfo(ares_channel_t *channel,
|
429
|
+
struct ares_addrinfo_node *ai_node);
|
430
|
+
|
431
|
+
void ares_freeaddrinfo_nodes(struct ares_addrinfo_node *ai_node);
|
432
|
+
ares_bool_t ares_is_localhost(const char *name);
|
433
|
+
|
434
|
+
struct ares_addrinfo_node *
|
435
|
+
ares_append_addrinfo_node(struct ares_addrinfo_node **ai_node);
|
436
|
+
void ares_addrinfo_cat_nodes(struct ares_addrinfo_node **head,
|
437
|
+
struct ares_addrinfo_node *tail);
|
438
|
+
|
439
|
+
void ares_freeaddrinfo_cnames(struct ares_addrinfo_cname *ai_cname);
|
440
|
+
|
441
|
+
struct ares_addrinfo_cname *
|
442
|
+
ares_append_addrinfo_cname(struct ares_addrinfo_cname **ai_cname);
|
443
|
+
|
444
|
+
ares_status_t ares_append_ai_node(int aftype, unsigned short port,
|
445
|
+
unsigned int ttl, const void *adata,
|
446
|
+
struct ares_addrinfo_node **nodes);
|
447
|
+
|
448
|
+
void ares_addrinfo_cat_cnames(struct ares_addrinfo_cname **head,
|
449
|
+
struct ares_addrinfo_cname *tail);
|
450
|
+
|
451
|
+
ares_status_t ares_parse_into_addrinfo(const ares_dns_record_t *dnsrec,
|
452
|
+
ares_bool_t cname_only_is_enodata,
|
453
|
+
unsigned short port,
|
454
|
+
struct ares_addrinfo *ai);
|
455
|
+
ares_status_t ares_parse_ptr_reply_dnsrec(const ares_dns_record_t *dnsrec,
|
456
|
+
const void *addr, int addrlen,
|
457
|
+
int family, struct hostent **host);
|
458
|
+
|
459
|
+
/* host address must be valid or NULL as will create or append */
|
460
|
+
ares_status_t ares_addrinfo2hostent(const struct ares_addrinfo *ai, int family,
|
461
|
+
struct hostent **host);
|
462
|
+
|
463
|
+
ares_status_t ares_addrinfo2addrttl(const struct ares_addrinfo *ai, int family,
|
464
|
+
size_t req_naddrttls,
|
465
|
+
struct ares_addrttl *addrttls,
|
466
|
+
struct ares_addr6ttl *addr6ttls,
|
467
|
+
size_t *naddrttls);
|
468
|
+
ares_status_t ares_addrinfo_localhost(const char *name, unsigned short port,
|
469
|
+
const struct ares_addrinfo_hints *hints,
|
470
|
+
struct ares_addrinfo *ai);
|
471
|
+
|
472
|
+
ares_status_t ares_servers_update(ares_channel_t *channel,
|
473
|
+
ares_llist_t *server_list,
|
474
|
+
ares_bool_t user_specified);
|
475
|
+
ares_status_t
|
476
|
+
ares_sconfig_append(const ares_channel_t *channel, ares_llist_t **sconfig,
|
477
|
+
const struct ares_addr *addr, unsigned short udp_port,
|
478
|
+
unsigned short tcp_port, const char *ll_iface);
|
479
|
+
ares_status_t ares_sconfig_append_fromstr(const ares_channel_t *channel,
|
480
|
+
ares_llist_t **sconfig,
|
481
|
+
const char *str,
|
482
|
+
ares_bool_t ignore_invalid);
|
483
|
+
ares_status_t ares_in_addr_to_sconfig_llist(const struct in_addr *servers,
|
484
|
+
size_t nservers,
|
485
|
+
ares_llist_t **llist);
|
486
|
+
ares_status_t ares_get_server_addr(const ares_server_t *server,
|
487
|
+
ares_buf_t *buf);
|
488
|
+
|
489
|
+
struct ares_hosts_entry;
|
490
|
+
typedef struct ares_hosts_entry ares_hosts_entry_t;
|
491
|
+
|
492
|
+
void ares_hosts_file_destroy(ares_hosts_file_t *hf);
|
493
|
+
ares_status_t ares_hosts_search_ipaddr(ares_channel_t *channel,
|
494
|
+
ares_bool_t use_env, const char *ipaddr,
|
495
|
+
const ares_hosts_entry_t **entry);
|
496
|
+
ares_status_t ares_hosts_search_host(ares_channel_t *channel,
|
497
|
+
ares_bool_t use_env, const char *host,
|
498
|
+
const ares_hosts_entry_t **entry);
|
499
|
+
ares_status_t ares_hosts_entry_to_hostent(const ares_hosts_entry_t *entry,
|
500
|
+
int family, struct hostent **hostent);
|
501
|
+
ares_status_t ares_hosts_entry_to_addrinfo(const ares_hosts_entry_t *entry,
|
502
|
+
const char *name, int family,
|
503
|
+
unsigned short port,
|
504
|
+
ares_bool_t want_cnames,
|
505
|
+
struct ares_addrinfo *ai);
|
506
|
+
|
507
|
+
/* Same as ares_query_dnsrec() except does not take a channel lock. Use this
|
508
|
+
* if a channel lock is already held */
|
509
|
+
ares_status_t ares_query_nolock(ares_channel_t *channel, const char *name,
|
510
|
+
ares_dns_class_t dnsclass,
|
511
|
+
ares_dns_rec_type_t type,
|
512
|
+
ares_callback_dnsrec callback, void *arg,
|
513
|
+
unsigned short *qid);
|
514
|
+
|
515
|
+
/*! Flags controlling behavior for ares_send_nolock() */
|
516
|
+
typedef enum {
|
517
|
+
ARES_SEND_FLAG_NOCACHE = 1 << 0, /*!< Do not query the cache */
|
518
|
+
ARES_SEND_FLAG_NORETRY = 1 << 1 /*!< Do not retry this query on error */
|
519
|
+
} ares_send_flags_t;
|
520
|
+
|
521
|
+
/* Similar to ares_send_dnsrec() except does not take a channel lock, allows
|
522
|
+
* specifying a particular server to use, and also flags controlling behavior.
|
523
|
+
*/
|
524
|
+
ares_status_t ares_send_nolock(ares_channel_t *channel, ares_server_t *server,
|
525
|
+
ares_send_flags_t flags,
|
526
|
+
const ares_dns_record_t *dnsrec,
|
527
|
+
ares_callback_dnsrec callback, void *arg,
|
528
|
+
unsigned short *qid);
|
529
|
+
|
530
|
+
/* Same as ares_gethostbyaddr() except does not take a channel lock. Use this
|
531
|
+
* if a channel lock is already held */
|
532
|
+
void ares_gethostbyaddr_nolock(ares_channel_t *channel, const void *addr,
|
533
|
+
int addrlen, int family,
|
534
|
+
ares_host_callback callback, void *arg);
|
535
|
+
|
536
|
+
/*! Parse a compressed DNS name as defined in RFC1035 starting at the current
|
537
|
+
* offset within the buffer.
|
538
|
+
*
|
539
|
+
* It is assumed that either a const buffer is being used, or before
|
540
|
+
* the message processing was started that ares_buf_reclaim() was called.
|
541
|
+
*
|
542
|
+
* \param[in] buf Initialized buffer object
|
543
|
+
* \param[out] name Pointer passed by reference to be filled in with
|
544
|
+
* allocated string of the parsed name that must be
|
545
|
+
* ares_free()'d by the caller.
|
546
|
+
* \param[in] is_hostname if ARES_TRUE, will validate the character set for
|
547
|
+
* a valid hostname or will return error.
|
548
|
+
* \return ARES_SUCCESS on success
|
549
|
+
*/
|
550
|
+
ares_status_t ares_dns_name_parse(ares_buf_t *buf, char **name,
|
551
|
+
ares_bool_t is_hostname);
|
552
|
+
|
553
|
+
/*! Write the DNS name to the buffer in the DNS domain-name syntax as a
|
554
|
+
* series of labels. The maximum domain name length is 255 characters with
|
555
|
+
* each label being a maximum of 63 characters. If the validate_hostname
|
556
|
+
* flag is set, it will strictly validate the character set.
|
557
|
+
*
|
558
|
+
* \param[in,out] buf Initialized buffer object to write name to
|
559
|
+
* \param[in,out] list Pointer passed by reference to maintain a list of
|
560
|
+
* domain name to indexes used for name compression.
|
561
|
+
* Pass NULL (not by reference) if name compression isn't
|
562
|
+
* desired. Otherwise the list will be automatically
|
563
|
+
* created upon first entry.
|
564
|
+
* \param[in] validate_hostname Validate the hostname character set.
|
565
|
+
* \param[in] name Name to write out, it may have escape
|
566
|
+
* sequences.
|
567
|
+
* \return ARES_SUCCESS on success, most likely ARES_EBADNAME if the name is
|
568
|
+
* bad.
|
569
|
+
*/
|
570
|
+
ares_status_t ares_dns_name_write(ares_buf_t *buf, ares_llist_t **list,
|
571
|
+
ares_bool_t validate_hostname,
|
572
|
+
const char *name);
|
573
|
+
|
574
|
+
/*! Check if the queue is empty, if so, wake any waiters. This is only
|
575
|
+
* effective if built with threading support.
|
576
|
+
*
|
577
|
+
* Must be holding a channel lock when calling this function.
|
578
|
+
*
|
579
|
+
* \param[in] channel Initialized ares channel object
|
580
|
+
*/
|
581
|
+
void ares_queue_notify_empty(ares_channel_t *channel);
|
582
|
+
|
583
|
+
#define ARES_CONFIG_CHECK(x) \
|
584
|
+
(x && x->lookups && ares_slist_len(x->servers) > 0 && x->timeout > 0 && \
|
585
|
+
x->tries > 0)
|
586
|
+
|
587
|
+
ares_bool_t ares_subnet_match(const struct ares_addr *addr,
|
588
|
+
const struct ares_addr *subnet,
|
589
|
+
unsigned char netmask);
|
590
|
+
ares_bool_t ares_addr_is_linklocal(const struct ares_addr *addr);
|
591
|
+
|
592
|
+
void ares_qcache_destroy(ares_qcache_t *cache);
|
593
|
+
ares_status_t ares_qcache_create(ares_rand_state *rand_state,
|
594
|
+
unsigned int max_ttl,
|
595
|
+
ares_qcache_t **cache_out);
|
596
|
+
void ares_qcache_flush(ares_qcache_t *cache);
|
597
|
+
ares_status_t ares_qcache_insert(ares_channel_t *channel,
|
598
|
+
const ares_timeval_t *now,
|
599
|
+
const ares_query_t *query,
|
600
|
+
ares_dns_record_t *dnsrec);
|
601
|
+
ares_status_t ares_qcache_fetch(ares_channel_t *channel,
|
602
|
+
const ares_timeval_t *now,
|
603
|
+
const ares_dns_record_t *dnsrec,
|
604
|
+
const ares_dns_record_t **dnsrec_resp);
|
605
|
+
|
606
|
+
void ares_metrics_record(const ares_query_t *query, ares_server_t *server,
|
607
|
+
ares_status_t status, const ares_dns_record_t *dnsrec);
|
608
|
+
size_t ares_metrics_server_timeout(const ares_server_t *server,
|
609
|
+
const ares_timeval_t *now);
|
610
|
+
|
611
|
+
ares_status_t ares_cookie_apply(ares_dns_record_t *dnsrec, ares_conn_t *conn,
|
612
|
+
const ares_timeval_t *now);
|
613
|
+
ares_status_t ares_cookie_validate(ares_query_t *query,
|
614
|
+
const ares_dns_record_t *dnsresp,
|
615
|
+
ares_conn_t *conn,
|
616
|
+
const ares_timeval_t *now,
|
617
|
+
ares_array_t **requeue);
|
618
|
+
|
619
|
+
ares_status_t ares_channel_threading_init(ares_channel_t *channel);
|
620
|
+
void ares_channel_threading_destroy(ares_channel_t *channel);
|
621
|
+
void ares_channel_lock(const ares_channel_t *channel);
|
622
|
+
void ares_channel_unlock(const ares_channel_t *channel);
|
623
|
+
|
624
|
+
struct ares_event_thread;
|
625
|
+
typedef struct ares_event_thread ares_event_thread_t;
|
626
|
+
|
627
|
+
void ares_event_thread_destroy(ares_channel_t *channel);
|
628
|
+
ares_status_t ares_event_thread_init(ares_channel_t *channel);
|
629
|
+
|
630
|
+
|
631
|
+
#ifdef _WIN32
|
632
|
+
# define HOSTENT_ADDRTYPE_TYPE short
|
633
|
+
# define HOSTENT_LENGTH_TYPE short
|
634
|
+
#else
|
635
|
+
# define HOSTENT_ADDRTYPE_TYPE int
|
636
|
+
# define HOSTENT_LENGTH_TYPE int
|
637
|
+
#endif
|
436
638
|
|
437
639
|
#endif /* __ARES_PRIVATE_H */
|