grpc 1.10.0 → 1.11.0.pre2
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.
- checksums.yaml +4 -4
- data/Makefile +2098 -501
- data/include/grpc/byte_buffer.h +2 -0
- data/include/grpc/byte_buffer_reader.h +2 -0
- data/include/grpc/census.h +2 -0
- data/include/grpc/fork.h +2 -0
- data/include/grpc/grpc.h +10 -0
- data/include/grpc/grpc_cronet.h +2 -0
- data/include/grpc/grpc_posix.h +2 -1
- data/include/grpc/grpc_security.h +21 -0
- data/include/grpc/grpc_security_constants.h +1 -0
- data/include/grpc/impl/codegen/byte_buffer.h +2 -0
- data/include/grpc/impl/codegen/grpc_types.h +24 -0
- data/include/grpc/impl/codegen/slice.h +1 -1
- data/include/grpc/impl/codegen/sync.h +1 -0
- data/include/grpc/impl/codegen/sync_custom.h +2 -0
- data/include/grpc/impl/codegen/sync_generic.h +2 -0
- data/include/grpc/impl/codegen/sync_posix.h +2 -0
- data/include/grpc/impl/codegen/sync_windows.h +2 -0
- data/include/grpc/slice.h +2 -0
- data/include/grpc/slice_buffer.h +2 -0
- data/include/grpc/status.h +2 -0
- data/include/grpc/support/alloc.h +2 -2
- data/include/grpc/support/atm.h +2 -0
- data/include/grpc/support/atm_gcc_atomic.h +2 -0
- data/include/grpc/support/atm_gcc_sync.h +2 -0
- data/include/grpc/support/atm_windows.h +2 -0
- data/include/grpc/support/log.h +1 -1
- data/include/grpc/support/sync.h +2 -0
- data/include/grpc/support/sync_custom.h +2 -0
- data/include/grpc/support/sync_generic.h +2 -0
- data/include/grpc/support/sync_posix.h +2 -0
- data/include/grpc/support/sync_windows.h +2 -0
- data/include/grpc/support/time.h +2 -0
- data/src/boringssl/err_data.c +444 -438
- data/src/core/ext/census/grpc_context.cc +2 -0
- data/src/core/ext/filters/client_channel/backup_poller.cc +13 -8
- data/src/core/ext/filters/client_channel/backup_poller.h +3 -2
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +2 -0
- data/src/core/ext/filters/client_channel/client_channel.cc +1988 -433
- data/src/core/ext/filters/client_channel/client_channel.h +2 -0
- data/src/core/ext/filters/client_channel/client_channel_factory.cc +2 -0
- data/src/core/ext/filters/client_channel/client_channel_factory.h +2 -0
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +2 -27
- data/src/core/ext/filters/client_channel/connector.cc +2 -0
- data/src/core/ext/filters/client_channel/connector.h +2 -0
- data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +2 -0
- data/src/core/ext/filters/client_channel/http_proxy.cc +2 -0
- data/src/core/ext/filters/client_channel/lb_policy.cc +2 -0
- data/src/core/ext/filters/client_channel/lb_policy.h +2 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +2 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +2 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +96 -78
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +9 -17
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +70 -62
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +2 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +2 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +2 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +2 -0
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +4 -2
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +4 -2
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc +2 -0
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +2 -0
- data/src/core/ext/filters/client_channel/lb_policy_factory.cc +3 -1
- data/src/core/ext/filters/client_channel/lb_policy_factory.h +2 -1
- data/src/core/ext/filters/client_channel/lb_policy_registry.cc +2 -0
- data/src/core/ext/filters/client_channel/lb_policy_registry.h +2 -1
- data/src/core/ext/filters/client_channel/method_params.cc +178 -0
- data/src/core/ext/filters/client_channel/method_params.h +74 -0
- data/src/core/ext/filters/client_channel/parse_address.cc +17 -13
- data/src/core/ext/filters/client_channel/parse_address.h +2 -0
- data/src/core/ext/filters/client_channel/proxy_mapper.cc +2 -0
- data/src/core/ext/filters/client_channel/proxy_mapper.h +2 -0
- data/src/core/ext/filters/client_channel/proxy_mapper_registry.cc +2 -0
- data/src/core/ext/filters/client_channel/proxy_mapper_registry.h +2 -0
- data/src/core/ext/filters/client_channel/resolver.cc +2 -0
- data/src/core/ext/filters/client_channel/resolver.h +6 -0
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +24 -5
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +2 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +1 -0
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +55 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +8 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc +1 -0
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +30 -3
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +7 -0
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +2 -1
- data/src/core/ext/filters/client_channel/resolver_factory.h +2 -0
- data/src/core/ext/filters/client_channel/resolver_registry.cc +2 -0
- data/src/core/ext/filters/client_channel/resolver_registry.h +2 -0
- data/src/core/ext/filters/client_channel/retry_throttle.cc +102 -120
- data/src/core/ext/filters/client_channel/retry_throttle.h +52 -25
- data/src/core/ext/filters/client_channel/subchannel.cc +14 -4
- data/src/core/ext/filters/client_channel/subchannel.h +10 -1
- data/src/core/ext/filters/client_channel/subchannel_index.cc +2 -0
- data/src/core/ext/filters/client_channel/subchannel_index.h +2 -0
- data/src/core/ext/filters/client_channel/uri_parser.cc +2 -1
- data/src/core/ext/filters/client_channel/uri_parser.h +2 -1
- data/src/core/ext/filters/deadline/deadline_filter.cc +2 -1
- data/src/core/ext/filters/deadline/deadline_filter.h +2 -0
- data/src/core/ext/filters/http/client/http_client_filter.cc +27 -25
- data/src/core/ext/filters/http/client/http_client_filter.h +2 -0
- data/src/core/ext/filters/http/client_authority_filter.cc +156 -0
- data/src/core/ext/filters/http/client_authority_filter.h +34 -0
- data/src/core/ext/filters/http/http_filters_plugin.cc +2 -0
- data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +21 -22
- data/src/core/ext/filters/http/message_compress/message_compress_filter.h +2 -0
- data/src/core/ext/filters/http/server/http_server_filter.cc +11 -8
- data/src/core/ext/filters/http/server/http_server_filter.h +2 -0
- data/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc +2 -0
- data/src/core/ext/filters/load_reporting/server_load_reporting_filter.h +2 -0
- data/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h +2 -0
- data/src/core/ext/filters/max_age/max_age_filter.cc +2 -0
- data/src/core/ext/filters/max_age/max_age_filter.h +2 -0
- data/src/core/ext/filters/message_size/message_size_filter.cc +52 -49
- data/src/core/ext/filters/message_size/message_size_filter.h +2 -0
- data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc +5 -1
- data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h +2 -0
- data/src/core/ext/filters/workarounds/workaround_utils.cc +2 -0
- data/src/core/ext/filters/workarounds/workaround_utils.h +2 -0
- data/src/core/ext/transport/chttp2/alpn/alpn.cc +3 -1
- data/src/core/ext/transport/chttp2/alpn/alpn.h +2 -0
- data/src/core/ext/transport/chttp2/client/authority.cc +42 -0
- data/src/core/ext/transport/chttp2/client/authority.h +36 -0
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +2 -0
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +2 -0
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +10 -3
- data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +2 -2
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +37 -25
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +2 -0
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +3 -1
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +2 -1
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +2 -1
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +3 -1
- data/src/core/ext/transport/chttp2/transport/bin_decoder.h +2 -0
- data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/bin_encoder.h +2 -0
- data/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +152 -182
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +2 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.h +1 -0
- data/src/core/ext/transport/chttp2/transport/frame.h +2 -1
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +15 -19
- data/src/core/ext/transport/chttp2/transport/frame_data.h +7 -5
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +2 -1
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +2 -1
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +2 -1
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +2 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +2 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +2 -2
- data/src/core/ext/transport/chttp2/transport/hpack_table.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/hpack_table.h +2 -1
- data/src/core/ext/transport/chttp2/transport/http2_settings.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +2 -0
- data/src/core/ext/transport/chttp2/transport/huffsyms.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/incoming_metadata.cc +3 -2
- data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +2 -0
- data/src/core/ext/transport/chttp2/transport/internal.h +60 -24
- data/src/core/ext/transport/chttp2/transport/parsing.cc +2 -4
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/stream_map.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/varint.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/writing.cc +10 -6
- data/src/core/ext/transport/inproc/inproc_plugin.cc +2 -0
- data/src/core/ext/transport/inproc/inproc_transport.cc +20 -23
- data/src/core/ext/transport/inproc/inproc_transport.h +2 -0
- data/src/core/lib/avl/avl.cc +2 -0
- data/src/core/lib/avl/avl.h +2 -0
- data/src/core/lib/backoff/backoff.cc +2 -0
- data/src/core/lib/backoff/backoff.h +2 -0
- data/src/core/lib/channel/channel_args.h +2 -0
- data/src/core/lib/channel/channel_stack.cc +3 -1
- data/src/core/lib/channel/channel_stack.h +2 -0
- data/src/core/lib/channel/channel_stack_builder.cc +2 -0
- data/src/core/lib/channel/channel_stack_builder.h +2 -0
- data/src/core/lib/channel/channel_trace.cc +239 -0
- data/src/core/lib/channel/channel_trace.h +133 -0
- data/src/core/lib/channel/channel_trace_registry.cc +80 -0
- data/src/core/lib/channel/channel_trace_registry.h +43 -0
- data/src/core/lib/channel/connected_channel.cc +2 -0
- data/src/core/lib/channel/connected_channel.h +2 -0
- data/src/core/lib/channel/handshaker.cc +2 -0
- data/src/core/lib/channel/handshaker.h +2 -0
- data/src/core/lib/channel/handshaker_factory.cc +2 -0
- data/src/core/lib/channel/handshaker_factory.h +2 -1
- data/src/core/lib/channel/handshaker_registry.cc +2 -0
- data/src/core/lib/channel/handshaker_registry.h +2 -1
- data/src/core/lib/channel/status_util.cc +100 -0
- data/src/core/lib/channel/status_util.h +58 -0
- data/src/core/lib/compression/algorithm_metadata.h +2 -0
- data/src/core/lib/compression/compression.cc +2 -0
- data/src/core/lib/compression/compression_internal.cc +2 -0
- data/src/core/lib/compression/compression_internal.h +2 -0
- data/src/core/lib/compression/message_compress.cc +2 -0
- data/src/core/lib/compression/message_compress.h +2 -0
- data/src/core/lib/compression/stream_compression.cc +2 -0
- data/src/core/lib/compression/stream_compression.h +2 -0
- data/src/core/lib/compression/stream_compression_gzip.cc +2 -0
- data/src/core/lib/compression/stream_compression_gzip.h +2 -0
- data/src/core/lib/compression/stream_compression_identity.cc +2 -1
- data/src/core/lib/compression/stream_compression_identity.h +2 -0
- data/src/core/lib/debug/stats.cc +2 -0
- data/src/core/lib/debug/stats.h +2 -0
- data/src/core/lib/debug/stats_data.cc +3 -1
- data/src/core/lib/debug/stats_data.h +2 -0
- data/src/core/lib/debug/trace.cc +2 -0
- data/src/core/lib/debug/trace.h +2 -1
- data/src/core/lib/gpr/alloc.cc +2 -1
- data/src/core/lib/gpr/arena.cc +47 -0
- data/src/core/lib/gpr/arena.h +2 -0
- data/src/core/lib/gpr/atm.cc +2 -0
- data/src/core/lib/gpr/cpu_linux.cc +5 -1
- data/src/core/lib/gpr/cpu_posix.cc +1 -1
- data/src/core/lib/gpr/env.h +2 -0
- data/src/core/lib/gpr/fork.cc +2 -0
- data/src/core/lib/gpr/host_port.cc +2 -0
- data/src/core/lib/gpr/log.cc +2 -1
- data/src/core/lib/gpr/log_linux.cc +1 -0
- data/src/core/lib/gpr/mpscq.cc +2 -0
- data/src/core/lib/gpr/mpscq.h +2 -0
- data/src/core/lib/gpr/murmur_hash.cc +2 -0
- data/src/core/lib/gpr/spinlock.h +2 -0
- data/src/core/lib/gpr/string.cc +2 -1
- data/src/core/lib/gpr/string.h +2 -2
- data/src/core/lib/gpr/sync.cc +2 -0
- data/src/core/lib/gpr/time.cc +2 -0
- data/src/core/lib/gpr/time_posix.cc +1 -0
- data/src/core/lib/gpr/time_precise.cc +2 -0
- data/src/core/lib/gpr/time_precise.h +2 -0
- data/src/core/lib/gpr/tls_gcc.h +2 -0
- data/src/core/lib/gpr/tls_msvc.h +2 -0
- data/src/core/lib/gpr/tls_pthread.h +2 -0
- data/src/core/lib/gpr/tmpfile.h +2 -0
- data/src/core/lib/gprpp/atomic_with_atm.h +2 -0
- data/src/core/lib/gprpp/atomic_with_std.h +2 -0
- data/src/core/lib/gprpp/inlined_vector.h +2 -0
- data/src/core/lib/gprpp/manual_constructor.h +3 -1
- data/src/core/lib/gprpp/memory.h +5 -3
- data/src/core/lib/gprpp/orphanable.h +3 -0
- data/src/core/lib/gprpp/ref_counted.h +4 -0
- data/src/core/lib/gprpp/ref_counted_ptr.h +3 -0
- data/src/core/lib/gprpp/thd.h +135 -0
- data/src/core/lib/gprpp/thd_posix.cc +209 -0
- data/src/core/lib/gprpp/thd_windows.cc +162 -0
- data/src/core/lib/http/format_request.cc +2 -0
- data/src/core/lib/http/format_request.h +2 -0
- data/src/core/lib/http/httpcli.cc +2 -0
- data/src/core/lib/http/httpcli.h +2 -0
- data/src/core/lib/http/httpcli_security_connector.cc +16 -7
- data/src/core/lib/http/parser.cc +2 -0
- data/src/core/lib/http/parser.h +2 -1
- data/src/core/lib/iomgr/call_combiner.cc +2 -0
- data/src/core/lib/iomgr/call_combiner.h +2 -1
- data/src/core/lib/iomgr/combiner.cc +2 -0
- data/src/core/lib/iomgr/combiner.h +2 -0
- data/src/core/lib/iomgr/endpoint.cc +4 -0
- data/src/core/lib/iomgr/endpoint.h +2 -0
- data/src/core/lib/iomgr/endpoint_pair.h +2 -0
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +2 -0
- data/src/core/lib/iomgr/endpoint_pair_uv.cc +2 -0
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +7 -4
- data/src/core/lib/iomgr/error.h +2 -0
- data/src/core/lib/iomgr/error_internal.h +2 -0
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +2 -0
- data/src/core/lib/iomgr/ev_epoll1_linux.h +2 -0
- data/src/core/lib/iomgr/ev_epollex_linux.cc +4 -18
- data/src/core/lib/iomgr/ev_epollex_linux.h +2 -0
- data/src/core/lib/iomgr/ev_epollsig_linux.cc +2 -0
- data/src/core/lib/iomgr/ev_epollsig_linux.h +2 -0
- data/src/core/lib/iomgr/ev_poll_posix.cc +61 -31
- data/src/core/lib/iomgr/ev_poll_posix.h +2 -0
- data/src/core/lib/iomgr/ev_posix.cc +35 -19
- data/src/core/lib/iomgr/ev_posix.h +2 -0
- data/src/core/lib/iomgr/ev_windows.cc +2 -0
- data/src/core/lib/iomgr/exec_ctx.cc +3 -1
- data/src/core/lib/iomgr/exec_ctx.h +21 -9
- data/src/core/lib/iomgr/executor.cc +13 -11
- data/src/core/lib/iomgr/executor.h +2 -0
- data/src/core/lib/iomgr/fork_posix.cc +4 -2
- data/src/core/lib/iomgr/fork_windows.cc +2 -0
- data/src/core/lib/iomgr/gethostname_fallback.cc +2 -0
- data/src/core/lib/iomgr/gethostname_host_name_max.cc +2 -0
- data/src/core/lib/iomgr/gethostname_sysconf.cc +2 -0
- data/src/core/lib/iomgr/iocp_windows.cc +3 -1
- data/src/core/lib/iomgr/iocp_windows.h +3 -0
- data/src/core/lib/iomgr/iomgr.cc +2 -1
- data/src/core/lib/iomgr/iomgr.h +2 -0
- data/src/core/lib/iomgr/iomgr_custom.cc +63 -0
- data/src/core/lib/iomgr/iomgr_custom.h +47 -0
- data/src/core/lib/iomgr/iomgr_internal.cc +43 -0
- data/src/core/lib/iomgr/iomgr_internal.h +14 -0
- data/src/core/lib/iomgr/iomgr_posix.cc +30 -3
- data/src/core/lib/iomgr/iomgr_posix.h +2 -0
- data/src/core/lib/iomgr/iomgr_uv.cc +17 -20
- data/src/core/lib/iomgr/iomgr_windows.cc +29 -3
- data/src/core/lib/iomgr/is_epollexclusive_available.cc +2 -0
- data/src/core/lib/iomgr/is_epollexclusive_available.h +2 -0
- data/src/core/lib/iomgr/load_file.cc +2 -0
- data/src/core/lib/iomgr/load_file.h +2 -0
- data/src/core/lib/iomgr/lockfree_event.cc +2 -0
- data/src/core/lib/iomgr/lockfree_event.h +14 -1
- data/src/core/lib/iomgr/nameser.h +2 -0
- data/src/core/lib/iomgr/network_status_tracker.cc +3 -1
- data/src/core/lib/iomgr/network_status_tracker.h +2 -0
- data/src/core/lib/iomgr/polling_entity.cc +2 -0
- data/src/core/lib/iomgr/polling_entity.h +2 -0
- data/src/core/lib/iomgr/pollset.cc +56 -0
- data/src/core/lib/iomgr/pollset.h +19 -0
- data/src/core/lib/iomgr/pollset_custom.cc +106 -0
- data/src/core/lib/iomgr/{timer_generic.h → pollset_custom.h} +15 -17
- data/src/core/lib/iomgr/pollset_set.cc +55 -0
- data/src/core/lib/iomgr/pollset_set.h +13 -0
- data/src/core/lib/iomgr/pollset_set_custom.cc +48 -0
- data/src/core/lib/iomgr/{pollset_uv.h → pollset_set_custom.h} +6 -7
- data/src/core/lib/iomgr/pollset_set_windows.cc +17 -10
- data/src/core/lib/iomgr/pollset_set_windows.h +2 -0
- data/src/core/lib/iomgr/pollset_uv.cc +42 -105
- data/src/core/lib/iomgr/pollset_windows.cc +20 -12
- data/src/core/lib/iomgr/pollset_windows.h +2 -0
- data/src/core/lib/iomgr/port.h +10 -19
- data/src/core/lib/iomgr/resolve_address.cc +50 -0
- data/src/core/lib/iomgr/resolve_address.h +39 -10
- data/src/core/lib/iomgr/resolve_address_custom.cc +187 -0
- data/src/core/lib/iomgr/resolve_address_custom.h +43 -0
- data/src/core/lib/iomgr/resolve_address_posix.cc +10 -22
- data/src/core/lib/iomgr/resolve_address_windows.cc +10 -22
- data/src/core/lib/iomgr/resource_quota.cc +2 -0
- data/src/core/lib/iomgr/resource_quota.h +3 -5
- data/src/core/lib/iomgr/sockaddr.h +3 -11
- data/src/core/lib/iomgr/sockaddr_custom.h +54 -0
- data/src/core/lib/iomgr/sockaddr_posix.h +26 -0
- data/src/core/lib/iomgr/sockaddr_utils.cc +91 -71
- data/src/core/lib/iomgr/sockaddr_utils.h +4 -0
- data/src/core/lib/iomgr/sockaddr_windows.h +21 -0
- data/src/core/lib/iomgr/socket_factory_posix.cc +2 -0
- data/src/core/lib/iomgr/socket_factory_posix.h +2 -0
- data/src/core/lib/iomgr/socket_mutator.cc +2 -0
- data/src/core/lib/iomgr/socket_mutator.h +2 -0
- data/src/core/lib/iomgr/socket_utils.h +11 -0
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +15 -6
- data/src/core/lib/iomgr/socket_utils_linux.cc +4 -4
- data/src/core/lib/iomgr/socket_utils_posix.cc +3 -2
- data/src/core/lib/iomgr/socket_utils_posix.h +2 -0
- data/src/core/lib/iomgr/socket_utils_uv.cc +13 -2
- data/src/core/lib/iomgr/socket_utils_windows.cc +10 -0
- data/src/core/lib/iomgr/socket_windows.cc +2 -0
- data/src/core/lib/iomgr/socket_windows.h +2 -1
- data/src/core/lib/iomgr/sys_epoll_wrapper.h +2 -0
- data/src/core/lib/iomgr/tcp_client.cc +36 -0
- data/src/core/lib/iomgr/tcp_client.h +13 -0
- data/src/core/lib/iomgr/tcp_client_custom.cc +151 -0
- data/src/core/lib/iomgr/tcp_client_posix.cc +11 -24
- data/src/core/lib/iomgr/tcp_client_posix.h +2 -0
- data/src/core/lib/iomgr/tcp_client_windows.cc +10 -23
- data/src/core/lib/iomgr/tcp_custom.cc +365 -0
- data/src/core/lib/iomgr/tcp_custom.h +81 -0
- data/src/core/lib/iomgr/tcp_posix.cc +3 -1
- data/src/core/lib/iomgr/tcp_posix.h +2 -0
- data/src/core/lib/iomgr/tcp_server.cc +73 -0
- data/src/core/lib/iomgr/tcp_server.h +24 -0
- data/src/core/lib/iomgr/tcp_server_custom.cc +472 -0
- data/src/core/lib/iomgr/tcp_server_posix.cc +41 -23
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +2 -0
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +7 -7
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +8 -6
- data/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc +2 -0
- data/src/core/lib/iomgr/tcp_server_windows.cc +43 -21
- data/src/core/lib/iomgr/tcp_uv.cc +308 -314
- data/src/core/lib/iomgr/tcp_windows.cc +3 -1
- data/src/core/lib/iomgr/tcp_windows.h +2 -0
- data/src/core/lib/iomgr/time_averaged_stats.cc +2 -0
- data/src/core/lib/iomgr/timer.cc +45 -0
- data/src/core/lib/iomgr/timer.h +36 -15
- data/src/core/lib/iomgr/timer_custom.cc +93 -0
- data/src/core/lib/iomgr/timer_custom.h +43 -0
- data/src/core/lib/iomgr/timer_generic.cc +12 -10
- data/src/core/lib/iomgr/timer_heap.cc +2 -4
- data/src/core/lib/iomgr/timer_heap.h +2 -0
- data/src/core/lib/iomgr/timer_manager.cc +12 -20
- data/src/core/lib/iomgr/timer_manager.h +2 -0
- data/src/core/lib/iomgr/timer_uv.cc +15 -49
- data/src/core/lib/iomgr/udp_server.cc +271 -230
- data/src/core/lib/iomgr/udp_server.h +44 -20
- data/src/core/lib/iomgr/unix_sockets_posix.cc +10 -7
- data/src/core/lib/iomgr/unix_sockets_posix.h +2 -0
- data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +2 -0
- data/src/core/lib/iomgr/wakeup_fd_cv.cc +3 -1
- data/src/core/lib/iomgr/wakeup_fd_cv.h +2 -0
- data/src/core/lib/iomgr/wakeup_fd_eventfd.cc +2 -0
- data/src/core/lib/iomgr/wakeup_fd_nospecial.cc +2 -0
- data/src/core/lib/iomgr/wakeup_fd_pipe.cc +2 -0
- data/src/core/lib/iomgr/wakeup_fd_pipe.h +2 -0
- data/src/core/lib/iomgr/wakeup_fd_posix.cc +2 -0
- data/src/core/lib/iomgr/wakeup_fd_posix.h +2 -0
- data/src/core/lib/json/json.cc +38 -0
- data/src/core/lib/json/json.h +22 -1
- data/src/core/lib/json/json_reader.cc +2 -2
- data/src/core/lib/json/json_reader.h +1 -0
- data/src/core/lib/json/json_string.cc +2 -0
- data/src/core/lib/json/json_writer.cc +2 -2
- data/src/core/lib/json/json_writer.h +2 -0
- data/src/core/lib/profiling/basic_timers.cc +11 -9
- data/src/core/lib/profiling/timers.h +6 -3
- data/src/core/lib/security/context/security_context.cc +2 -0
- data/src/core/lib/security/context/security_context.h +2 -0
- data/src/core/lib/security/credentials/alts/alts_credentials.cc +119 -0
- data/src/core/lib/security/credentials/alts/alts_credentials.h +102 -0
- data/src/core/lib/security/credentials/alts/check_gcp_environment.cc +72 -0
- data/src/core/lib/security/credentials/alts/check_gcp_environment.h +57 -0
- data/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc +67 -0
- data/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc +33 -0
- data/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc +114 -0
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc +126 -0
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc +46 -0
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h +112 -0
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc +58 -0
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +2 -0
- data/src/core/lib/security/credentials/composite/composite_credentials.h +2 -0
- data/src/core/lib/security/credentials/credentials.cc +2 -0
- data/src/core/lib/security/credentials/credentials.h +2 -0
- data/src/core/lib/security/credentials/credentials_metadata.cc +2 -0
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +2 -3
- data/src/core/lib/security/credentials/fake/fake_credentials.h +5 -0
- data/src/core/lib/security/credentials/google_default/credentials_generic.cc +2 -0
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +2 -0
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +2 -0
- data/src/core/lib/security/credentials/iam/iam_credentials.h +2 -0
- data/src/core/lib/security/credentials/jwt/json_token.cc +2 -0
- data/src/core/lib/security/credentials/jwt/json_token.h +2 -0
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +2 -0
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +2 -0
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +2 -0
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +2 -0
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +2 -0
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +2 -0
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +2 -0
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +11 -2
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +2 -0
- data/src/core/lib/security/security_connector/alts_security_connector.cc +287 -0
- data/src/core/lib/security/security_connector/alts_security_connector.h +69 -0
- data/src/core/lib/security/security_connector/security_connector.cc +174 -74
- data/src/core/lib/security/security_connector/security_connector.h +41 -7
- data/src/core/lib/security/transport/auth_filters.h +2 -0
- data/src/core/lib/security/transport/client_auth_filter.cc +14 -28
- data/src/core/lib/security/transport/secure_endpoint.cc +2 -0
- data/src/core/lib/security/transport/secure_endpoint.h +2 -0
- data/src/core/lib/security/transport/security_handshaker.cc +2 -0
- data/src/core/lib/security/transport/security_handshaker.h +2 -1
- data/src/core/lib/security/transport/server_auth_filter.cc +2 -0
- data/src/core/lib/security/transport/target_authority_table.cc +75 -0
- data/src/core/lib/security/transport/{lb_targets_info.h → target_authority_table.h} +16 -8
- data/src/core/lib/security/transport/tsi_error.cc +2 -0
- data/src/core/lib/security/transport/tsi_error.h +2 -0
- data/src/core/lib/security/util/json_util.cc +2 -0
- data/src/core/lib/security/util/json_util.h +2 -0
- data/src/core/lib/slice/b64.cc +2 -0
- data/src/core/lib/slice/b64.h +2 -0
- data/src/core/lib/slice/percent_encoding.cc +2 -0
- data/src/core/lib/slice/percent_encoding.h +2 -0
- data/src/core/lib/slice/slice.cc +2 -0
- data/src/core/lib/slice/slice_buffer.cc +3 -1
- data/src/core/lib/slice/slice_hash_table.h +178 -45
- data/src/core/lib/slice/slice_intern.cc +2 -0
- data/src/core/lib/slice/slice_internal.h +2 -2
- data/src/core/lib/slice/slice_string_helpers.cc +2 -0
- data/src/core/lib/slice/slice_string_helpers.h +2 -1
- data/src/core/lib/slice/slice_weak_hash_table.h +105 -0
- data/src/core/lib/surface/api_trace.cc +3 -1
- data/src/core/lib/surface/api_trace.h +2 -0
- data/src/core/lib/surface/byte_buffer.cc +3 -0
- data/src/core/lib/surface/byte_buffer_reader.cc +3 -0
- data/src/core/lib/surface/call.cc +46 -80
- data/src/core/lib/surface/call.h +2 -0
- data/src/core/lib/surface/call_details.cc +2 -0
- data/src/core/lib/surface/call_log_batch.cc +2 -0
- data/src/core/lib/surface/call_test_only.h +2 -0
- data/src/core/lib/surface/channel.cc +72 -41
- data/src/core/lib/surface/channel.h +2 -0
- data/src/core/lib/surface/channel_init.cc +2 -0
- data/src/core/lib/surface/channel_init.h +2 -0
- data/src/core/lib/surface/channel_ping.cc +2 -0
- data/src/core/lib/surface/channel_stack_type.cc +3 -2
- data/src/core/lib/surface/channel_stack_type.h +2 -0
- data/src/core/lib/surface/completion_queue.h +2 -0
- data/src/core/lib/surface/completion_queue_factory.cc +3 -1
- data/src/core/lib/surface/completion_queue_factory.h +2 -0
- data/src/core/lib/surface/event_string.cc +2 -0
- data/src/core/lib/surface/event_string.h +2 -0
- data/src/core/lib/surface/init.cc +5 -2
- data/src/core/lib/surface/init_secure.cc +5 -2
- data/src/core/lib/surface/lame_client.cc +7 -5
- data/src/core/lib/surface/lame_client.h +2 -0
- data/src/core/lib/surface/metadata_array.cc +2 -0
- data/src/core/lib/surface/server.cc +2 -0
- data/src/core/lib/surface/server.h +2 -0
- data/src/core/lib/surface/validate_metadata.cc +2 -1
- data/src/core/lib/surface/validate_metadata.h +2 -0
- data/src/core/lib/surface/version.cc +4 -2
- data/src/core/lib/transport/bdp_estimator.cc +2 -0
- data/src/core/lib/transport/byte_stream.cc +94 -116
- data/src/core/lib/transport/byte_stream.h +111 -78
- data/src/core/lib/transport/connectivity_state.cc +2 -0
- data/src/core/lib/transport/connectivity_state.h +3 -1
- data/src/core/lib/transport/error_utils.cc +2 -0
- data/src/core/lib/transport/error_utils.h +2 -0
- data/src/core/lib/transport/metadata.cc +2 -0
- data/src/core/lib/transport/metadata.h +3 -1
- data/src/core/lib/transport/metadata_batch.cc +26 -0
- data/src/core/lib/transport/metadata_batch.h +12 -1
- data/src/core/lib/transport/pid_controller.cc +2 -0
- data/src/core/lib/transport/pid_controller.h +2 -0
- data/src/core/lib/transport/service_config.cc +21 -175
- data/src/core/lib/transport/service_config.h +223 -35
- data/src/core/lib/transport/static_metadata.cc +310 -294
- data/src/core/lib/transport/static_metadata.h +96 -82
- data/src/core/lib/transport/status_conversion.cc +2 -0
- data/src/core/lib/transport/status_conversion.h +3 -0
- data/src/core/lib/transport/status_metadata.cc +54 -0
- data/src/core/lib/{iomgr/timer_uv.h → transport/status_metadata.h} +10 -12
- data/src/core/lib/transport/timeout_encoding.cc +2 -1
- data/src/core/lib/transport/timeout_encoding.h +2 -0
- data/src/core/lib/transport/transport.cc +3 -1
- data/src/core/lib/transport/transport.h +33 -7
- data/src/core/lib/transport/transport_impl.h +2 -0
- data/src/core/lib/transport/transport_op_string.cc +10 -3
- data/src/core/plugin_registry/grpc_plugin_registry.cc +10 -4
- data/src/core/tsi/alts/crypt/aes_gcm.cc +687 -0
- data/src/core/tsi/alts/crypt/gsec.cc +189 -0
- data/src/core/tsi/alts/crypt/gsec.h +454 -0
- data/src/core/tsi/alts/frame_protector/alts_counter.cc +118 -0
- data/src/core/tsi/alts/frame_protector/alts_counter.h +98 -0
- data/src/core/tsi/alts/frame_protector/alts_crypter.cc +66 -0
- data/src/core/tsi/alts/frame_protector/alts_crypter.h +255 -0
- data/src/core/tsi/alts/frame_protector/alts_frame_protector.cc +407 -0
- data/src/core/tsi/alts/frame_protector/alts_frame_protector.h +55 -0
- data/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.cc +114 -0
- data/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h +114 -0
- data/src/core/tsi/alts/frame_protector/alts_seal_privacy_integrity_crypter.cc +105 -0
- data/src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc +103 -0
- data/src/core/tsi/alts/frame_protector/frame_handler.cc +218 -0
- data/src/core/tsi/alts/frame_protector/frame_handler.h +236 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +316 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +137 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc +520 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_service_api.h +323 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc +143 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h +149 -0
- data/src/core/tsi/alts/handshaker/alts_tsi_event.cc +73 -0
- data/src/core/tsi/alts/handshaker/alts_tsi_event.h +93 -0
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +483 -0
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +83 -0
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +52 -0
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.cc +58 -0
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.h +52 -0
- data/src/core/tsi/alts/handshaker/altscontext.pb.c +48 -0
- data/src/core/tsi/alts/handshaker/altscontext.pb.h +64 -0
- data/src/core/tsi/alts/handshaker/handshaker.pb.c +123 -0
- data/src/core/tsi/alts/handshaker/handshaker.pb.h +255 -0
- data/src/core/tsi/alts/handshaker/transport_security_common.pb.c +50 -0
- data/src/core/tsi/alts/handshaker/transport_security_common.pb.h +78 -0
- data/src/core/tsi/alts/handshaker/transport_security_common_api.cc +196 -0
- data/src/core/tsi/alts/handshaker/transport_security_common_api.h +163 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc +180 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h +52 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc +144 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h +49 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h +91 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +174 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h +100 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc +476 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h +199 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +296 -0
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h +52 -0
- data/src/core/tsi/alts_transport_security.cc +3 -1
- data/src/core/tsi/alts_transport_security.h +4 -2
- data/src/core/tsi/fake_transport_security.cc +2 -1
- data/src/core/tsi/fake_transport_security.h +2 -0
- data/src/core/tsi/ssl/session_cache/ssl_session.h +73 -0
- data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +58 -0
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +211 -0
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +93 -0
- data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +76 -0
- data/src/core/tsi/ssl_transport_security.cc +266 -62
- data/src/core/tsi/ssl_transport_security.h +128 -6
- data/src/core/tsi/ssl_types.h +2 -0
- data/src/core/tsi/transport_security.cc +2 -0
- data/src/core/tsi/transport_security.h +2 -0
- data/src/core/tsi/transport_security_adapter.cc +2 -0
- data/src/core/tsi/transport_security_adapter.h +2 -0
- data/src/core/tsi/transport_security_grpc.cc +2 -0
- data/src/core/tsi/transport_security_grpc.h +2 -0
- data/src/core/tsi/transport_security_interface.h +2 -0
- data/src/ruby/ext/grpc/extconf.rb +1 -2
- data/src/ruby/ext/grpc/rb_call.c +1 -13
- data/src/ruby/ext/grpc/rb_channel.c +6 -6
- data/src/ruby/ext/grpc/rb_compression_options.c +1 -1
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +10 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +15 -0
- data/src/ruby/lib/grpc/core/time_consts.rb +1 -1
- data/src/ruby/lib/grpc/generic/bidi_call.rb +19 -8
- data/src/ruby/lib/grpc/generic/client_stub.rb +6 -10
- data/src/ruby/lib/grpc/generic/interceptors.rb +1 -1
- data/src/ruby/lib/grpc/generic/rpc_server.rb +2 -2
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/spec/generic/client_stub_spec.rb +133 -0
- data/src/ruby/spec/pb/package_with_underscore/checker_spec.rb +54 -0
- data/src/ruby/spec/pb/package_with_underscore/data.proto +23 -0
- data/src/ruby/spec/pb/package_with_underscore/service.proto +23 -0
- data/third_party/address_sorting/address_sorting.c +369 -0
- data/third_party/address_sorting/address_sorting_internal.h +70 -0
- data/third_party/address_sorting/address_sorting_posix.c +97 -0
- data/third_party/address_sorting/address_sorting_windows.c +55 -0
- data/third_party/address_sorting/include/address_sorting/address_sorting.h +110 -0
- data/third_party/boringssl/crypto/asn1/a_enum.c +20 -9
- data/third_party/boringssl/crypto/asn1/a_i2d_fp.c +3 -0
- data/third_party/boringssl/crypto/asn1/a_int.c +19 -8
- data/third_party/boringssl/crypto/asn1/a_object.c +0 -128
- data/third_party/boringssl/crypto/asn1/asn1_locl.h +3 -0
- data/third_party/boringssl/crypto/asn1/tasn_fre.c +2 -4
- data/third_party/boringssl/crypto/asn1/tasn_new.c +3 -2
- data/third_party/boringssl/crypto/bn_extra/bn_asn1.c +0 -16
- data/third_party/boringssl/crypto/buf/buf.c +14 -0
- data/third_party/boringssl/crypto/bytestring/cbb.c +93 -0
- data/third_party/boringssl/crypto/conf/conf.c +2 -2
- data/third_party/boringssl/crypto/cpu-intel.c +17 -17
- data/third_party/boringssl/crypto/crypto.c +16 -4
- data/third_party/boringssl/crypto/curve25519/spake25519.c +11 -11
- data/third_party/boringssl/crypto/curve25519/x25519-x86_64.c +1 -1
- data/third_party/boringssl/crypto/dsa/dsa.c +9 -21
- data/third_party/boringssl/crypto/ec_extra/ec_asn1.c +2 -2
- data/third_party/boringssl/crypto/ecdsa_extra/ecdsa_asn1.c +1 -8
- data/third_party/boringssl/crypto/evp/p_rsa_asn1.c +2 -23
- data/third_party/boringssl/crypto/ex_data.c +0 -1
- data/third_party/boringssl/crypto/fipsmodule/bn/add.c +7 -11
- data/third_party/boringssl/crypto/fipsmodule/bn/asm/x86_64-gcc.c +19 -16
- data/third_party/boringssl/crypto/fipsmodule/bn/cmp.c +15 -0
- data/third_party/boringssl/crypto/fipsmodule/bn/div.c +53 -46
- data/third_party/boringssl/crypto/fipsmodule/bn/exponentiation.c +242 -85
- data/third_party/boringssl/crypto/fipsmodule/bn/generic.c +42 -47
- data/third_party/boringssl/crypto/fipsmodule/bn/internal.h +176 -34
- data/third_party/boringssl/crypto/fipsmodule/bn/montgomery.c +118 -65
- data/third_party/boringssl/crypto/fipsmodule/bn/mul.c +94 -61
- data/third_party/boringssl/crypto/fipsmodule/bn/random.c +79 -63
- data/third_party/boringssl/crypto/fipsmodule/bn/shift.c +26 -28
- data/third_party/boringssl/crypto/fipsmodule/cipher/cipher.c +2 -0
- data/third_party/boringssl/crypto/fipsmodule/ec/ec.c +250 -149
- data/third_party/boringssl/crypto/fipsmodule/ec/ec_montgomery.c +0 -27
- data/third_party/boringssl/crypto/fipsmodule/ec/internal.h +54 -20
- data/third_party/boringssl/crypto/fipsmodule/ec/oct.c +3 -3
- data/third_party/boringssl/crypto/fipsmodule/ec/p224-64.c +7 -41
- data/third_party/boringssl/crypto/fipsmodule/ec/p256-64.c +6 -40
- data/third_party/boringssl/crypto/fipsmodule/ec/p256-x86_64.c +17 -122
- data/third_party/boringssl/crypto/fipsmodule/ec/simple.c +3 -64
- data/third_party/boringssl/crypto/fipsmodule/ec/wnaf.c +27 -9
- data/third_party/boringssl/crypto/fipsmodule/ecdsa/ecdsa.c +203 -205
- data/third_party/boringssl/crypto/fipsmodule/modes/cbc.c +14 -15
- data/third_party/boringssl/crypto/fipsmodule/modes/cfb.c +12 -8
- data/third_party/boringssl/crypto/fipsmodule/modes/ctr.c +4 -3
- data/third_party/boringssl/crypto/fipsmodule/modes/gcm.c +25 -36
- data/third_party/boringssl/crypto/fipsmodule/modes/internal.h +10 -0
- data/third_party/boringssl/crypto/fipsmodule/rsa/internal.h +0 -4
- data/third_party/boringssl/crypto/fipsmodule/rsa/rsa.c +2 -0
- data/third_party/boringssl/crypto/fipsmodule/rsa/rsa_impl.c +9 -19
- data/third_party/boringssl/crypto/lhash/lhash.c +19 -0
- data/third_party/boringssl/crypto/obj/obj.c +29 -69
- data/third_party/boringssl/crypto/pem/pem_lib.c +2 -2
- data/third_party/boringssl/crypto/poly1305/poly1305_vec.c +4 -55
- data/third_party/boringssl/crypto/rsa_extra/rsa_asn1.c +3 -22
- data/third_party/boringssl/crypto/x509/by_dir.c +1 -3
- data/third_party/boringssl/crypto/x509/by_file.c +0 -1
- data/third_party/boringssl/crypto/x509/x509_lu.c +0 -1
- data/third_party/boringssl/crypto/x509/x509_obj.c +1 -3
- data/third_party/boringssl/crypto/x509/x509_txt.c +0 -6
- data/third_party/boringssl/crypto/x509/x509_vfy.c +0 -1
- data/third_party/boringssl/crypto/x509/x509_vpm.c +0 -1
- data/third_party/boringssl/crypto/x509/x_algor.c +2 -2
- data/third_party/boringssl/crypto/x509v3/v3_alt.c +3 -4
- data/third_party/boringssl/crypto/x509v3/v3_genn.c +1 -0
- data/third_party/boringssl/crypto/x509v3/v3_info.c +1 -2
- data/third_party/boringssl/crypto/x509v3/v3_lib.c +15 -7
- data/third_party/boringssl/crypto/x509v3/v3_utl.c +41 -2
- data/third_party/boringssl/include/openssl/asn1.h +0 -1
- data/third_party/boringssl/include/openssl/base.h +1 -1
- data/third_party/boringssl/include/openssl/bio.h +5 -2
- data/third_party/boringssl/include/openssl/bn.h +2 -17
- data/third_party/boringssl/include/openssl/buf.h +4 -0
- data/third_party/boringssl/include/openssl/bytestring.h +11 -0
- data/third_party/boringssl/include/openssl/chacha.h +5 -1
- data/third_party/boringssl/include/openssl/cipher.h +10 -0
- data/third_party/boringssl/include/openssl/conf.h +4 -8
- data/third_party/boringssl/include/openssl/dsa.h +2 -18
- data/third_party/boringssl/include/openssl/ec.h +5 -5
- data/third_party/boringssl/include/openssl/ecdsa.h +10 -28
- data/third_party/boringssl/include/openssl/evp.h +0 -4
- data/third_party/boringssl/include/openssl/lhash.h +1 -18
- data/third_party/boringssl/include/openssl/obj.h +1 -0
- data/third_party/boringssl/include/openssl/rsa.h +3 -4
- data/third_party/boringssl/include/openssl/ssl.h +35 -54
- data/third_party/boringssl/include/openssl/ssl3.h +2 -0
- data/third_party/boringssl/include/openssl/stack.h +1 -1
- data/third_party/boringssl/include/openssl/tls1.h +1 -16
- data/third_party/boringssl/include/openssl/x509.h +3 -2
- data/third_party/boringssl/include/openssl/x509_vfy.h +0 -2
- data/third_party/boringssl/include/openssl/x509v3.h +1 -0
- data/third_party/boringssl/ssl/custom_extensions.cc +1 -1
- data/third_party/boringssl/ssl/d1_both.cc +120 -129
- data/third_party/boringssl/ssl/d1_lib.cc +23 -21
- data/third_party/boringssl/ssl/d1_pkt.cc +39 -143
- data/third_party/boringssl/ssl/dtls_method.cc +16 -23
- data/third_party/boringssl/ssl/dtls_record.cc +11 -4
- data/third_party/boringssl/ssl/handshake.cc +109 -40
- data/third_party/boringssl/ssl/handshake_client.cc +104 -96
- data/third_party/boringssl/ssl/handshake_server.cc +62 -72
- data/third_party/boringssl/ssl/internal.h +397 -318
- data/third_party/boringssl/ssl/s3_both.cc +173 -191
- data/third_party/boringssl/ssl/s3_lib.cc +26 -34
- data/third_party/boringssl/ssl/s3_pkt.cc +105 -247
- data/third_party/boringssl/ssl/ssl_asn1.cc +22 -22
- data/third_party/boringssl/ssl/ssl_buffer.cc +98 -108
- data/third_party/boringssl/ssl/ssl_cert.cc +12 -1
- data/third_party/boringssl/ssl/ssl_cipher.cc +23 -28
- data/third_party/boringssl/ssl/ssl_key_share.cc +11 -6
- data/third_party/boringssl/ssl/ssl_lib.cc +190 -113
- data/third_party/boringssl/ssl/ssl_privkey.cc +76 -106
- data/third_party/boringssl/ssl/ssl_session.cc +3 -3
- data/third_party/boringssl/ssl/ssl_stat.cc +3 -3
- data/third_party/boringssl/ssl/ssl_transcript.cc +38 -22
- data/third_party/boringssl/ssl/ssl_versions.cc +64 -31
- data/third_party/boringssl/ssl/t1_enc.cc +137 -154
- data/third_party/boringssl/ssl/t1_lib.cc +463 -478
- data/third_party/boringssl/ssl/tls13_both.cc +57 -58
- data/third_party/boringssl/ssl/tls13_client.cc +256 -121
- data/third_party/boringssl/ssl/tls13_enc.cc +187 -72
- data/third_party/boringssl/ssl/tls13_server.cc +187 -86
- data/third_party/boringssl/ssl/tls_method.cc +20 -30
- data/third_party/boringssl/ssl/tls_record.cc +77 -40
- data/third_party/boringssl/third_party/fiat/curve25519.c +5062 -0
- data/third_party/boringssl/{crypto/curve25519 → third_party/fiat}/internal.h +40 -27
- data/third_party/nanopb/pb.h +1 -1
- metadata +147 -45
- data/src/core/lib/gpr/thd.cc +0 -49
- data/src/core/lib/gpr/thd.h +0 -71
- data/src/core/lib/gpr/thd_posix.cc +0 -154
- data/src/core/lib/gpr/thd_windows.cc +0 -107
- data/src/core/lib/iomgr/iomgr_uv.h +0 -37
- data/src/core/lib/iomgr/pollset_set_uv.cc +0 -43
- data/src/core/lib/iomgr/resolve_address_uv.cc +0 -284
- data/src/core/lib/iomgr/tcp_client_uv.cc +0 -175
- data/src/core/lib/iomgr/tcp_server_uv.cc +0 -471
- data/src/core/lib/iomgr/tcp_uv.h +0 -51
- data/src/core/lib/security/transport/lb_targets_info.cc +0 -59
- data/src/core/lib/slice/slice_hash_table.cc +0 -145
- data/third_party/boringssl/crypto/curve25519/curve25519.c +0 -4938
@@ -16,6 +16,8 @@
|
|
16
16
|
*
|
17
17
|
*/
|
18
18
|
|
19
|
+
#include <grpc/support/port_platform.h>
|
20
|
+
|
19
21
|
#include "src/core/lib/iomgr/port.h"
|
20
22
|
#ifdef GRPC_POSIX_SOCKET
|
21
23
|
|
@@ -33,14 +35,14 @@
|
|
33
35
|
|
34
36
|
#include "src/core/lib/gpr/host_port.h"
|
35
37
|
#include "src/core/lib/gpr/string.h"
|
36
|
-
#include "src/core/lib/gpr/thd.h"
|
37
38
|
#include "src/core/lib/gpr/useful.h"
|
39
|
+
#include "src/core/lib/gprpp/thd.h"
|
38
40
|
#include "src/core/lib/iomgr/block_annotate.h"
|
39
41
|
#include "src/core/lib/iomgr/executor.h"
|
40
42
|
#include "src/core/lib/iomgr/iomgr_internal.h"
|
41
43
|
#include "src/core/lib/iomgr/unix_sockets_posix.h"
|
42
44
|
|
43
|
-
static grpc_error*
|
45
|
+
static grpc_error* posix_blocking_resolve_address(
|
44
46
|
const char* name, const char* default_port,
|
45
47
|
grpc_resolved_addresses** addresses) {
|
46
48
|
grpc_core::ExecCtx exec_ctx;
|
@@ -139,10 +141,6 @@ done:
|
|
139
141
|
return err;
|
140
142
|
}
|
141
143
|
|
142
|
-
grpc_error* (*grpc_blocking_resolve_address)(
|
143
|
-
const char* name, const char* default_port,
|
144
|
-
grpc_resolved_addresses** addresses) = blocking_resolve_address_impl;
|
145
|
-
|
146
144
|
typedef struct {
|
147
145
|
char* name;
|
148
146
|
char* default_port;
|
@@ -163,17 +161,10 @@ static void do_request_thread(void* rp, grpc_error* error) {
|
|
163
161
|
gpr_free(r);
|
164
162
|
}
|
165
163
|
|
166
|
-
void
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
gpr_free(addrs);
|
171
|
-
}
|
172
|
-
|
173
|
-
static void resolve_address_impl(const char* name, const char* default_port,
|
174
|
-
grpc_pollset_set* interested_parties,
|
175
|
-
grpc_closure* on_done,
|
176
|
-
grpc_resolved_addresses** addrs) {
|
164
|
+
static void posix_resolve_address(const char* name, const char* default_port,
|
165
|
+
grpc_pollset_set* interested_parties,
|
166
|
+
grpc_closure* on_done,
|
167
|
+
grpc_resolved_addresses** addrs) {
|
177
168
|
request* r = static_cast<request*>(gpr_malloc(sizeof(request)));
|
178
169
|
GRPC_CLOSURE_INIT(&r->request_closure, do_request_thread, r,
|
179
170
|
grpc_executor_scheduler(GRPC_EXECUTOR_SHORT));
|
@@ -184,9 +175,6 @@ static void resolve_address_impl(const char* name, const char* default_port,
|
|
184
175
|
GRPC_CLOSURE_SCHED(&r->request_closure, GRPC_ERROR_NONE);
|
185
176
|
}
|
186
177
|
|
187
|
-
|
188
|
-
|
189
|
-
grpc_pollset_set* interested_parties, grpc_closure* on_done,
|
190
|
-
grpc_resolved_addresses** addrs) = resolve_address_impl;
|
191
|
-
|
178
|
+
grpc_address_resolver_vtable grpc_posix_resolver_vtable = {
|
179
|
+
posix_resolve_address, posix_blocking_resolve_address};
|
192
180
|
#endif
|
@@ -16,6 +16,8 @@
|
|
16
16
|
*
|
17
17
|
*/
|
18
18
|
|
19
|
+
#include <grpc/support/port_platform.h>
|
20
|
+
|
19
21
|
#include "src/core/lib/iomgr/port.h"
|
20
22
|
#ifdef GRPC_WINSOCK_SOCKET
|
21
23
|
|
@@ -35,7 +37,7 @@
|
|
35
37
|
|
36
38
|
#include "src/core/lib/gpr/host_port.h"
|
37
39
|
#include "src/core/lib/gpr/string.h"
|
38
|
-
#include "src/core/lib/
|
40
|
+
#include "src/core/lib/gprpp/thd.h"
|
39
41
|
#include "src/core/lib/iomgr/block_annotate.h"
|
40
42
|
#include "src/core/lib/iomgr/executor.h"
|
41
43
|
#include "src/core/lib/iomgr/iomgr_internal.h"
|
@@ -49,7 +51,7 @@ typedef struct {
|
|
49
51
|
grpc_resolved_addresses** addresses;
|
50
52
|
} request;
|
51
53
|
|
52
|
-
static grpc_error*
|
54
|
+
static grpc_error* windows_blocking_resolve_address(
|
53
55
|
const char* name, const char* default_port,
|
54
56
|
grpc_resolved_addresses** addresses) {
|
55
57
|
grpc_core::ExecCtx exec_ctx;
|
@@ -128,10 +130,6 @@ done:
|
|
128
130
|
return error;
|
129
131
|
}
|
130
132
|
|
131
|
-
grpc_error* (*grpc_blocking_resolve_address)(
|
132
|
-
const char* name, const char* default_port,
|
133
|
-
grpc_resolved_addresses** addresses) = blocking_resolve_address_impl;
|
134
|
-
|
135
133
|
/* Callback to be passed to grpc_executor to asynch-ify
|
136
134
|
* grpc_blocking_resolve_address */
|
137
135
|
static void do_request_thread(void* rp, grpc_error* error) {
|
@@ -148,17 +146,10 @@ static void do_request_thread(void* rp, grpc_error* error) {
|
|
148
146
|
gpr_free(r);
|
149
147
|
}
|
150
148
|
|
151
|
-
void
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
gpr_free(addrs);
|
156
|
-
}
|
157
|
-
|
158
|
-
static void resolve_address_impl(const char* name, const char* default_port,
|
159
|
-
grpc_pollset_set* interested_parties,
|
160
|
-
grpc_closure* on_done,
|
161
|
-
grpc_resolved_addresses** addresses) {
|
149
|
+
static void windows_resolve_address(const char* name, const char* default_port,
|
150
|
+
grpc_pollset_set* interested_parties,
|
151
|
+
grpc_closure* on_done,
|
152
|
+
grpc_resolved_addresses** addresses) {
|
162
153
|
request* r = (request*)gpr_malloc(sizeof(request));
|
163
154
|
GRPC_CLOSURE_INIT(&r->request_closure, do_request_thread, r,
|
164
155
|
grpc_executor_scheduler(GRPC_EXECUTOR_SHORT));
|
@@ -169,9 +160,6 @@ static void resolve_address_impl(const char* name, const char* default_port,
|
|
169
160
|
GRPC_CLOSURE_SCHED(&r->request_closure, GRPC_ERROR_NONE);
|
170
161
|
}
|
171
162
|
|
172
|
-
|
173
|
-
|
174
|
-
grpc_pollset_set* interested_parties, grpc_closure* on_done,
|
175
|
-
grpc_resolved_addresses** addresses) = resolve_address_impl;
|
176
|
-
|
163
|
+
grpc_address_resolver_vtable grpc_windows_resolver_vtable = {
|
164
|
+
windows_resolve_address, windows_blocking_resolve_address};
|
177
165
|
#endif
|
@@ -19,10 +19,12 @@
|
|
19
19
|
#ifndef GRPC_CORE_LIB_IOMGR_RESOURCE_QUOTA_H
|
20
20
|
#define GRPC_CORE_LIB_IOMGR_RESOURCE_QUOTA_H
|
21
21
|
|
22
|
+
#include <grpc/support/port_platform.h>
|
23
|
+
|
22
24
|
#include <grpc/grpc.h>
|
23
25
|
|
24
26
|
#include "src/core/lib/debug/trace.h"
|
25
|
-
#include "src/core/lib/iomgr/
|
27
|
+
#include "src/core/lib/iomgr/closure.h"
|
26
28
|
|
27
29
|
/** \file Tracks resource usage against a pool.
|
28
30
|
|
@@ -137,8 +139,4 @@ void grpc_resource_user_alloc_slices(
|
|
137
139
|
grpc_resource_user_slice_allocator* slice_allocator, size_t length,
|
138
140
|
size_t count, grpc_slice_buffer* dest);
|
139
141
|
|
140
|
-
/* Allocate one slice of length \a size synchronously. */
|
141
|
-
grpc_slice grpc_resource_user_slice_malloc(grpc_resource_user* resource_user,
|
142
|
-
size_t size);
|
143
|
-
|
144
142
|
#endif /* GRPC_CORE_LIB_IOMGR_RESOURCE_QUOTA_H */
|
@@ -23,18 +23,10 @@
|
|
23
23
|
#ifndef GRPC_CORE_LIB_IOMGR_SOCKADDR_H
|
24
24
|
#define GRPC_CORE_LIB_IOMGR_SOCKADDR_H
|
25
25
|
|
26
|
-
#include
|
26
|
+
#include <grpc/support/port_platform.h>
|
27
27
|
|
28
|
-
#
|
29
|
-
#include <uv.h>
|
30
|
-
#endif
|
31
|
-
|
32
|
-
#ifdef GPR_WINDOWS
|
33
|
-
#include "src/core/lib/iomgr/sockaddr_windows.h"
|
34
|
-
#endif
|
35
|
-
|
36
|
-
#ifdef GRPC_POSIX_SOCKETADDR
|
28
|
+
#include "src/core/lib/iomgr/sockaddr_custom.h"
|
37
29
|
#include "src/core/lib/iomgr/sockaddr_posix.h"
|
38
|
-
#
|
30
|
+
#include "src/core/lib/iomgr/sockaddr_windows.h"
|
39
31
|
|
40
32
|
#endif /* GRPC_CORE_LIB_IOMGR_SOCKADDR_H */
|
@@ -0,0 +1,54 @@
|
|
1
|
+
/*
|
2
|
+
*
|
3
|
+
* Copyright 2018 gRPC authors.
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*
|
17
|
+
*/
|
18
|
+
|
19
|
+
#ifndef GRPC_CORE_LIB_IOMGR_SOCKADDR_CUSTOM_H
|
20
|
+
#define GRPC_CORE_LIB_IOMGR_SOCKADDR_CUSTOM_H
|
21
|
+
|
22
|
+
#include <grpc/support/port_platform.h>
|
23
|
+
|
24
|
+
#include <stddef.h>
|
25
|
+
#include "src/core/lib/iomgr/port.h"
|
26
|
+
|
27
|
+
#ifdef GRPC_UV
|
28
|
+
|
29
|
+
#include <uv.h>
|
30
|
+
|
31
|
+
// TODO(kpayson) It would be nice to abstract this so we don't
|
32
|
+
// depend on anything uv specific
|
33
|
+
typedef struct sockaddr grpc_sockaddr;
|
34
|
+
typedef struct sockaddr_in grpc_sockaddr_in;
|
35
|
+
typedef struct in_addr grpc_in_addr;
|
36
|
+
typedef struct sockaddr_in6 grpc_sockaddr_in6;
|
37
|
+
typedef struct in6_addr grpc_in6_addr;
|
38
|
+
|
39
|
+
#define GRPC_INET_ADDRSTRLEN INET_ADDRSTRLEN
|
40
|
+
#define GRPC_INET6_ADDRSTRLEN INET6_ADDRSTRLEN
|
41
|
+
|
42
|
+
#define GRPC_SOCK_STREAM SOCK_STREAM
|
43
|
+
#define GRPC_SOCK_DGRAM SOCK_DGRAM
|
44
|
+
|
45
|
+
#define GRPC_AF_UNSPEC AF_UNSPEC
|
46
|
+
#define GRPC_AF_UNIX AF_UNIX
|
47
|
+
#define GRPC_AF_INET AF_INET
|
48
|
+
#define GRPC_AF_INET6 AF_INET6
|
49
|
+
|
50
|
+
#define GRPC_AI_PASSIVE AI_PASSIVE
|
51
|
+
|
52
|
+
#endif // GRPC_UV
|
53
|
+
|
54
|
+
#endif /* GRPC_CORE_LIB_IOMGR_SOCKADDR_CUSTOM_H */
|
@@ -19,6 +19,11 @@
|
|
19
19
|
#ifndef GRPC_CORE_LIB_IOMGR_SOCKADDR_POSIX_H
|
20
20
|
#define GRPC_CORE_LIB_IOMGR_SOCKADDR_POSIX_H
|
21
21
|
|
22
|
+
#include <grpc/support/port_platform.h>
|
23
|
+
|
24
|
+
#include "src/core/lib/iomgr/port.h"
|
25
|
+
|
26
|
+
#ifdef GRPC_POSIX_SOCKET
|
22
27
|
#include <arpa/inet.h>
|
23
28
|
#include <netdb.h>
|
24
29
|
#include <netinet/in.h>
|
@@ -26,4 +31,25 @@
|
|
26
31
|
#include <sys/types.h>
|
27
32
|
#include <unistd.h>
|
28
33
|
|
34
|
+
typedef struct sockaddr grpc_sockaddr;
|
35
|
+
typedef struct sockaddr_in grpc_sockaddr_in;
|
36
|
+
typedef struct in_addr grpc_in_addr;
|
37
|
+
typedef struct sockaddr_in6 grpc_sockaddr_in6;
|
38
|
+
typedef struct in6_addr grpc_in6_addr;
|
39
|
+
|
40
|
+
#define GRPC_INET_ADDRSTRLEN INET_ADDRSTRLEN
|
41
|
+
#define GRPC_INET6_ADDRSTRLEN INET6_ADDRSTRLEN
|
42
|
+
|
43
|
+
#define GRPC_SOCK_STREAM SOCK_STREAM
|
44
|
+
#define GRPC_SOCK_DGRAM SOCK_DGRAM
|
45
|
+
|
46
|
+
#define GRPC_AF_UNSPEC AF_UNSPEC
|
47
|
+
#define GRPC_AF_UNIX AF_UNIX
|
48
|
+
#define GRPC_AF_INET AF_INET
|
49
|
+
#define GRPC_AF_INET6 AF_INET6
|
50
|
+
|
51
|
+
#define GRPC_AI_PASSIVE AI_PASSIVE
|
52
|
+
|
53
|
+
#endif
|
54
|
+
|
29
55
|
#endif /* GRPC_CORE_LIB_IOMGR_SOCKADDR_POSIX_H */
|
@@ -16,6 +16,8 @@
|
|
16
16
|
*
|
17
17
|
*/
|
18
18
|
|
19
|
+
#include <grpc/support/port_platform.h>
|
20
|
+
|
19
21
|
#include "src/core/lib/iomgr/sockaddr_utils.h"
|
20
22
|
|
21
23
|
#include <errno.h>
|
@@ -24,7 +26,6 @@
|
|
24
26
|
|
25
27
|
#include <grpc/support/alloc.h>
|
26
28
|
#include <grpc/support/log.h>
|
27
|
-
#include <grpc/support/port_platform.h>
|
28
29
|
#include <grpc/support/string_util.h>
|
29
30
|
|
30
31
|
#include "src/core/lib/gpr/host_port.h"
|
@@ -39,25 +40,26 @@ static const uint8_t kV4MappedPrefix[] = {0, 0, 0, 0, 0, 0,
|
|
39
40
|
int grpc_sockaddr_is_v4mapped(const grpc_resolved_address* resolved_addr,
|
40
41
|
grpc_resolved_address* resolved_addr4_out) {
|
41
42
|
GPR_ASSERT(resolved_addr != resolved_addr4_out);
|
42
|
-
const
|
43
|
-
reinterpret_cast<const
|
44
|
-
|
43
|
+
const grpc_sockaddr* addr =
|
44
|
+
reinterpret_cast<const grpc_sockaddr*>(resolved_addr->addr);
|
45
|
+
grpc_sockaddr_in* addr4_out =
|
45
46
|
resolved_addr4_out == nullptr
|
46
47
|
? nullptr
|
47
|
-
: reinterpret_cast<
|
48
|
-
if (addr->sa_family ==
|
49
|
-
const
|
50
|
-
reinterpret_cast<const
|
48
|
+
: reinterpret_cast<grpc_sockaddr_in*>(resolved_addr4_out->addr);
|
49
|
+
if (addr->sa_family == GRPC_AF_INET6) {
|
50
|
+
const grpc_sockaddr_in6* addr6 =
|
51
|
+
reinterpret_cast<const grpc_sockaddr_in6*>(addr);
|
51
52
|
if (memcmp(addr6->sin6_addr.s6_addr, kV4MappedPrefix,
|
52
53
|
sizeof(kV4MappedPrefix)) == 0) {
|
53
54
|
if (resolved_addr4_out != nullptr) {
|
54
55
|
/* Normalize ::ffff:0.0.0.0/96 to IPv4. */
|
55
56
|
memset(resolved_addr4_out, 0, sizeof(*resolved_addr4_out));
|
56
|
-
addr4_out->sin_family =
|
57
|
+
addr4_out->sin_family = GRPC_AF_INET;
|
57
58
|
/* s6_addr32 would be nice, but it's non-standard. */
|
58
59
|
memcpy(&addr4_out->sin_addr, &addr6->sin6_addr.s6_addr[12], 4);
|
59
60
|
addr4_out->sin_port = addr6->sin6_port;
|
60
|
-
resolved_addr4_out->len =
|
61
|
+
resolved_addr4_out->len =
|
62
|
+
static_cast<socklen_t>(sizeof(grpc_sockaddr_in));
|
61
63
|
}
|
62
64
|
return 1;
|
63
65
|
}
|
@@ -68,19 +70,19 @@ int grpc_sockaddr_is_v4mapped(const grpc_resolved_address* resolved_addr,
|
|
68
70
|
int grpc_sockaddr_to_v4mapped(const grpc_resolved_address* resolved_addr,
|
69
71
|
grpc_resolved_address* resolved_addr6_out) {
|
70
72
|
GPR_ASSERT(resolved_addr != resolved_addr6_out);
|
71
|
-
const
|
72
|
-
reinterpret_cast<const
|
73
|
-
|
74
|
-
reinterpret_cast<
|
75
|
-
if (addr->sa_family ==
|
76
|
-
const
|
77
|
-
reinterpret_cast<const
|
73
|
+
const grpc_sockaddr* addr =
|
74
|
+
reinterpret_cast<const grpc_sockaddr*>(resolved_addr->addr);
|
75
|
+
grpc_sockaddr_in6* addr6_out =
|
76
|
+
reinterpret_cast<grpc_sockaddr_in6*>(resolved_addr6_out->addr);
|
77
|
+
if (addr->sa_family == GRPC_AF_INET) {
|
78
|
+
const grpc_sockaddr_in* addr4 =
|
79
|
+
reinterpret_cast<const grpc_sockaddr_in*>(addr);
|
78
80
|
memset(resolved_addr6_out, 0, sizeof(*resolved_addr6_out));
|
79
|
-
addr6_out->sin6_family =
|
81
|
+
addr6_out->sin6_family = GRPC_AF_INET6;
|
80
82
|
memcpy(&addr6_out->sin6_addr.s6_addr[0], kV4MappedPrefix, 12);
|
81
83
|
memcpy(&addr6_out->sin6_addr.s6_addr[12], &addr4->sin_addr, 4);
|
82
84
|
addr6_out->sin6_port = addr4->sin_port;
|
83
|
-
resolved_addr6_out->len = sizeof(
|
85
|
+
resolved_addr6_out->len = static_cast<socklen_t>(sizeof(grpc_sockaddr_in6));
|
84
86
|
return 1;
|
85
87
|
}
|
86
88
|
return 0;
|
@@ -88,32 +90,32 @@ int grpc_sockaddr_to_v4mapped(const grpc_resolved_address* resolved_addr,
|
|
88
90
|
|
89
91
|
int grpc_sockaddr_is_wildcard(const grpc_resolved_address* resolved_addr,
|
90
92
|
int* port_out) {
|
91
|
-
const
|
93
|
+
const grpc_sockaddr* addr;
|
92
94
|
grpc_resolved_address addr4_normalized;
|
93
95
|
if (grpc_sockaddr_is_v4mapped(resolved_addr, &addr4_normalized)) {
|
94
96
|
resolved_addr = &addr4_normalized;
|
95
97
|
}
|
96
|
-
addr = reinterpret_cast<const
|
97
|
-
if (addr->sa_family ==
|
98
|
+
addr = reinterpret_cast<const grpc_sockaddr*>(resolved_addr->addr);
|
99
|
+
if (addr->sa_family == GRPC_AF_INET) {
|
98
100
|
/* Check for 0.0.0.0 */
|
99
|
-
const
|
100
|
-
reinterpret_cast<const
|
101
|
+
const grpc_sockaddr_in* addr4 =
|
102
|
+
reinterpret_cast<const grpc_sockaddr_in*>(addr);
|
101
103
|
if (addr4->sin_addr.s_addr != 0) {
|
102
104
|
return 0;
|
103
105
|
}
|
104
|
-
*port_out =
|
106
|
+
*port_out = grpc_ntohs(addr4->sin_port);
|
105
107
|
return 1;
|
106
|
-
} else if (addr->sa_family ==
|
108
|
+
} else if (addr->sa_family == GRPC_AF_INET6) {
|
107
109
|
/* Check for :: */
|
108
|
-
const
|
109
|
-
reinterpret_cast<const
|
110
|
+
const grpc_sockaddr_in6* addr6 =
|
111
|
+
reinterpret_cast<const grpc_sockaddr_in6*>(addr);
|
110
112
|
int i;
|
111
113
|
for (i = 0; i < 16; i++) {
|
112
114
|
if (addr6->sin6_addr.s6_addr[i] != 0) {
|
113
115
|
return 0;
|
114
116
|
}
|
115
117
|
}
|
116
|
-
*port_out =
|
118
|
+
*port_out = grpc_ntohs(addr6->sin6_port);
|
117
119
|
return 1;
|
118
120
|
} else {
|
119
121
|
return 0;
|
@@ -128,33 +130,33 @@ void grpc_sockaddr_make_wildcards(int port, grpc_resolved_address* wild4_out,
|
|
128
130
|
|
129
131
|
void grpc_sockaddr_make_wildcard4(int port,
|
130
132
|
grpc_resolved_address* resolved_wild_out) {
|
131
|
-
|
132
|
-
reinterpret_cast<
|
133
|
+
grpc_sockaddr_in* wild_out =
|
134
|
+
reinterpret_cast<grpc_sockaddr_in*>(resolved_wild_out->addr);
|
133
135
|
GPR_ASSERT(port >= 0 && port < 65536);
|
134
136
|
memset(resolved_wild_out, 0, sizeof(*resolved_wild_out));
|
135
|
-
wild_out->sin_family =
|
136
|
-
wild_out->sin_port =
|
137
|
-
resolved_wild_out->len = sizeof(
|
137
|
+
wild_out->sin_family = GRPC_AF_INET;
|
138
|
+
wild_out->sin_port = grpc_htons(static_cast<uint16_t>(port));
|
139
|
+
resolved_wild_out->len = static_cast<socklen_t>(sizeof(grpc_sockaddr_in));
|
138
140
|
}
|
139
141
|
|
140
142
|
void grpc_sockaddr_make_wildcard6(int port,
|
141
143
|
grpc_resolved_address* resolved_wild_out) {
|
142
|
-
|
143
|
-
reinterpret_cast<
|
144
|
+
grpc_sockaddr_in6* wild_out =
|
145
|
+
reinterpret_cast<grpc_sockaddr_in6*>(resolved_wild_out->addr);
|
144
146
|
GPR_ASSERT(port >= 0 && port < 65536);
|
145
147
|
memset(resolved_wild_out, 0, sizeof(*resolved_wild_out));
|
146
|
-
wild_out->sin6_family =
|
147
|
-
wild_out->sin6_port =
|
148
|
-
resolved_wild_out->len = sizeof(
|
148
|
+
wild_out->sin6_family = GRPC_AF_INET6;
|
149
|
+
wild_out->sin6_port = grpc_htons(static_cast<uint16_t>(port));
|
150
|
+
resolved_wild_out->len = static_cast<socklen_t>(sizeof(grpc_sockaddr_in6));
|
149
151
|
}
|
150
152
|
|
151
153
|
int grpc_sockaddr_to_string(char** out,
|
152
154
|
const grpc_resolved_address* resolved_addr,
|
153
155
|
int normalize) {
|
154
|
-
const
|
156
|
+
const grpc_sockaddr* addr;
|
155
157
|
const int save_errno = errno;
|
156
158
|
grpc_resolved_address addr_normalized;
|
157
|
-
char ntop_buf[
|
159
|
+
char ntop_buf[GRPC_INET6_ADDRSTRLEN];
|
158
160
|
const void* ip = nullptr;
|
159
161
|
int port = 0;
|
160
162
|
uint32_t sin6_scope_id = 0;
|
@@ -164,17 +166,17 @@ int grpc_sockaddr_to_string(char** out,
|
|
164
166
|
if (normalize && grpc_sockaddr_is_v4mapped(resolved_addr, &addr_normalized)) {
|
165
167
|
resolved_addr = &addr_normalized;
|
166
168
|
}
|
167
|
-
addr = reinterpret_cast<const
|
168
|
-
if (addr->sa_family ==
|
169
|
-
const
|
170
|
-
reinterpret_cast<const
|
169
|
+
addr = reinterpret_cast<const grpc_sockaddr*>(resolved_addr->addr);
|
170
|
+
if (addr->sa_family == GRPC_AF_INET) {
|
171
|
+
const grpc_sockaddr_in* addr4 =
|
172
|
+
reinterpret_cast<const grpc_sockaddr_in*>(addr);
|
171
173
|
ip = &addr4->sin_addr;
|
172
|
-
port =
|
173
|
-
} else if (addr->sa_family ==
|
174
|
-
const
|
175
|
-
reinterpret_cast<const
|
174
|
+
port = grpc_ntohs(addr4->sin_port);
|
175
|
+
} else if (addr->sa_family == GRPC_AF_INET6) {
|
176
|
+
const grpc_sockaddr_in6* addr6 =
|
177
|
+
reinterpret_cast<const grpc_sockaddr_in6*>(addr);
|
176
178
|
ip = &addr6->sin6_addr;
|
177
|
-
port =
|
179
|
+
port = grpc_ntohs(addr6->sin6_port);
|
178
180
|
sin6_scope_id = addr6->sin6_scope_id;
|
179
181
|
}
|
180
182
|
if (ip != nullptr && grpc_inet_ntop(addr->sa_family, ip, ntop_buf,
|
@@ -196,6 +198,24 @@ int grpc_sockaddr_to_string(char** out,
|
|
196
198
|
return ret;
|
197
199
|
}
|
198
200
|
|
201
|
+
void grpc_string_to_sockaddr(grpc_resolved_address* out, char* addr, int port) {
|
202
|
+
grpc_sockaddr_in6* addr6 = (grpc_sockaddr_in6*)out->addr;
|
203
|
+
grpc_sockaddr_in* addr4 = (grpc_sockaddr_in*)out->addr;
|
204
|
+
|
205
|
+
if (grpc_inet_pton(GRPC_AF_INET6, addr, &addr6->sin6_addr) == 1) {
|
206
|
+
addr6->sin6_family = GRPC_AF_INET6;
|
207
|
+
addr6->sin6_flowinfo = 0;
|
208
|
+
addr6->sin6_scope_id = 0;
|
209
|
+
out->len = sizeof(grpc_sockaddr_in6);
|
210
|
+
} else if (grpc_inet_pton(GRPC_AF_INET, addr, &addr4->sin_addr) == 1) {
|
211
|
+
addr4->sin_family = GRPC_AF_INET;
|
212
|
+
out->len = sizeof(grpc_sockaddr_in);
|
213
|
+
} else {
|
214
|
+
GPR_ASSERT(0);
|
215
|
+
}
|
216
|
+
grpc_sockaddr_set_port(out, port);
|
217
|
+
}
|
218
|
+
|
199
219
|
char* grpc_sockaddr_to_uri(const grpc_resolved_address* resolved_addr) {
|
200
220
|
grpc_resolved_address addr_normalized;
|
201
221
|
if (grpc_sockaddr_is_v4mapped(resolved_addr, &addr_normalized)) {
|
@@ -218,33 +238,33 @@ char* grpc_sockaddr_to_uri(const grpc_resolved_address* resolved_addr) {
|
|
218
238
|
|
219
239
|
const char* grpc_sockaddr_get_uri_scheme(
|
220
240
|
const grpc_resolved_address* resolved_addr) {
|
221
|
-
const
|
222
|
-
reinterpret_cast<const
|
241
|
+
const grpc_sockaddr* addr =
|
242
|
+
reinterpret_cast<const grpc_sockaddr*>(resolved_addr->addr);
|
223
243
|
switch (addr->sa_family) {
|
224
|
-
case
|
244
|
+
case GRPC_AF_INET:
|
225
245
|
return "ipv4";
|
226
|
-
case
|
246
|
+
case GRPC_AF_INET6:
|
227
247
|
return "ipv6";
|
228
|
-
case
|
248
|
+
case GRPC_AF_UNIX:
|
229
249
|
return "unix";
|
230
250
|
}
|
231
251
|
return nullptr;
|
232
252
|
}
|
233
253
|
|
234
254
|
int grpc_sockaddr_get_family(const grpc_resolved_address* resolved_addr) {
|
235
|
-
const
|
236
|
-
reinterpret_cast<const
|
255
|
+
const grpc_sockaddr* addr =
|
256
|
+
reinterpret_cast<const grpc_sockaddr*>(resolved_addr->addr);
|
237
257
|
return addr->sa_family;
|
238
258
|
}
|
239
259
|
|
240
260
|
int grpc_sockaddr_get_port(const grpc_resolved_address* resolved_addr) {
|
241
|
-
const
|
242
|
-
reinterpret_cast<const
|
261
|
+
const grpc_sockaddr* addr =
|
262
|
+
reinterpret_cast<const grpc_sockaddr*>(resolved_addr->addr);
|
243
263
|
switch (addr->sa_family) {
|
244
|
-
case
|
245
|
-
return
|
246
|
-
case
|
247
|
-
return
|
264
|
+
case GRPC_AF_INET:
|
265
|
+
return grpc_ntohs(((grpc_sockaddr_in*)addr)->sin_port);
|
266
|
+
case GRPC_AF_INET6:
|
267
|
+
return grpc_ntohs(((grpc_sockaddr_in6*)addr)->sin6_port);
|
248
268
|
default:
|
249
269
|
if (grpc_is_unix_socket(resolved_addr)) {
|
250
270
|
return 1;
|
@@ -257,18 +277,18 @@ int grpc_sockaddr_get_port(const grpc_resolved_address* resolved_addr) {
|
|
257
277
|
|
258
278
|
int grpc_sockaddr_set_port(const grpc_resolved_address* resolved_addr,
|
259
279
|
int port) {
|
260
|
-
const
|
261
|
-
reinterpret_cast<const
|
280
|
+
const grpc_sockaddr* addr =
|
281
|
+
reinterpret_cast<const grpc_sockaddr*>(resolved_addr->addr);
|
262
282
|
switch (addr->sa_family) {
|
263
|
-
case
|
283
|
+
case GRPC_AF_INET:
|
264
284
|
GPR_ASSERT(port >= 0 && port < 65536);
|
265
|
-
((
|
266
|
-
|
285
|
+
((grpc_sockaddr_in*)addr)->sin_port =
|
286
|
+
grpc_htons(static_cast<uint16_t>(port));
|
267
287
|
return 1;
|
268
|
-
case
|
288
|
+
case GRPC_AF_INET6:
|
269
289
|
GPR_ASSERT(port >= 0 && port < 65536);
|
270
|
-
((
|
271
|
-
|
290
|
+
((grpc_sockaddr_in6*)addr)->sin6_port =
|
291
|
+
grpc_htons(static_cast<uint16_t>(port));
|
272
292
|
return 1;
|
273
293
|
default:
|
274
294
|
gpr_log(GPR_ERROR, "Unknown socket family %d in grpc_sockaddr_set_port",
|